Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • waDateTime
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class waDateTime

This file is part of Webasyst framework.

Licensed under the terms of the GNU Lesser General Public License (LGPL). http://www.webasyst.com/framework/license/

Package: wa-system\datetime
Copyright: 2011 Webasyst LLC
Author: Webasyst LLC
Link: http://www.webasyst.com/
Located at wa-system/datetime/waDateTime.class.php
Methods summary
public static array
# getTimeZones( )

Returns the list of available time zones with localized descriptions.

Returns the list of available time zones with localized descriptions.

Returns

array
public static
# getAllTimeZones( )
public static string
# getDefaultTimeZone( )

Returns the default time zone.

Returns the default time zone.

Returns

string
public static string
# date( string $format, integer|string|null $time = null, string|null $timezone = null, string|null $locale = null )

Returns date as string according to specified format.

Returns date as string according to specified format.

Parameters

$format
string
$format Date format. Format symbols acceptable for PHP function date are supported. To display month name in lowercase, character 'f' should be used.
$time
integer|string|null
$time Unix timestamp. If not specified, current timestamp is used.
$timezone
string|null
$timezone Time zone identifier. If not specified, the time zone is determined automatically.
$locale
string|null
$locale Locale identifier. If not specifed, current user's locale is determined automatically.

Returns

string
protected static
# convertFormat( mixed $format )
public static string
# format( string $format, string|null $time = null, string|null $timezone = null, string|null $locale = null )

Returns time as string according to specified format.

Returns time as string according to specified format.

Parameters

$format
string
$format Date/time format. The following format strings are acceptable: - 'humandatetime': adds words "yesterday", "today", "tomorrow" instead of appropriate dates relative to the current user date - 'humandate': returns the date in format 'd f Y' supported by method date (format strings listed below are also supported by that method) - 'date': returns date/time in format 'Y-m-d' - 'time': returns date/time in format 'H:i' - 'fulltime': returns date/time in format 'H:i:s' - 'datetime': returns date/time in format 'Y-m-d H:i' - 'fulldatetime': returns date/time in format 'Y-m-d H:i:s' - 'timestamp': returns date/time in format 'U'
$time
string|null
$time Unix timestamp. If not specified, current timestamp is used.
$timezone
string|null
$timezone Time zone identifier. If not specified, the time zone is determined automatically.
$locale
string|null
$locale Locale identifier. If not specifed, current user's locale is determined automatically.

Returns

string

See

wa_date()
public static string
# getFormat( string $format, string|null $locale = null )

Returns format strings for PHP function date corresponding to formats used by Webasyst framework.

Returns format strings for PHP function date corresponding to formats used by Webasyst framework.

Parameters

$format
string
$format Time format strings used in Webasyst framework including the following options: - 'date_formats' sub-array keys specified in locale configuration file located in wa-system/locale/data/, - PHP class DateTime constants, - format strings acceptable for PHP function date, or one of the identifiers corresponding to pre-defined time formatting strings supported by method format().
$locale
string|null
$locale Locale identifier. If not specifed, current user locale is determined automatically.

Returns

string

See

waDateTime::format()
public static
# getFormatJS( string $format, string|null $locale = null )

Returns format strings for date/time formatting by means of JavaScript code corresponding to formats used by Webasyst framework.

Returns format strings for date/time formatting by means of JavaScript code corresponding to formats used by Webasyst framework.

Parameters

$format
string
$format Format string accepted by parameter$format of method getFormat().
$locale
string|null
$locale Locale identifier. If not specifed, current user's locale is determined automatically.

See

waDateTime::getFormat()
string
public static string
# parse( string $format, string $string, string|null $timezone = null, string|null $locale = null )

Returns time value, formatted using one of the formats supported by Webasyst framework, as a string accepted by standard PHP functions.

Returns time value, formatted using one of the formats supported by Webasyst framework, as a string accepted by standard PHP functions.

Parameters

$format
string
$format Format string accepted by format() method except for 'humandatetime'.
$string
string
$string Date/time value string formatted to match the format identifier specified in $format parameter.
$timezone
string|null
$timezone Time zone identifier. If not specified, current time zone is determined automatically.
$locale
string|null
$locale Locale identifier. If not specifed, current user locale is determined automatically.

Returns

string

See

wa_parse_date()
waDateTime::format()
My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0