Class Horde_Kolab_Format_Date
Kolab date handling functions. Based upon Kolab.php from Stuart Binge.
Copyright 2004-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you did not
receive this file, see
http://www.horde.org/licenses/lgpl21.
Methods summary
public static
integer
|
#
decodeDate( string $date )
Returns a UNIX timestamp corresponding the given date string which is in
the format prescribed by the Kolab Format Specification.
Returns a UNIX timestamp corresponding the given date string which is in
the format prescribed by the Kolab Format Specification.
Parameters
- $date
- The string representation of the date.
Returns
integer The unix timestamp corresponding to $date.
|
public static
integer
|
#
decodeDateTime( string $datetime )
Returns a UNIX timestamp corresponding the given date-time string which
is in the format prescribed by the Kolab Format Specification.
Returns a UNIX timestamp corresponding the given date-time string which
is in the format prescribed by the Kolab Format Specification.
Parameters
- $datetime
- The string representation of the date & time.
Returns
integer The unix timestamp corresponding to $datetime.
|
public static
integer
|
#
decodeDateOrDateTime( string $date )
Returns a UNIX timestamp corresponding the given date or date-time
string which is in either format prescribed by the Kolab Format
Specification.
Returns a UNIX timestamp corresponding the given date or date-time
string which is in either format prescribed by the Kolab Format
Specification.
Parameters
- $date
- The string representation of the date (& time).
Returns
integer The unix timestamp corresponding to $date.
|
public static
string
|
#
encodeDate( integer $date = false )
Returns a string containing the current UTC date in the format
prescribed by the Kolab Format Specification.
Returns a string containing the current UTC date in the format
prescribed by the Kolab Format Specification.
Parameters
- $date
- The integer representation of the date.
Returns
string The current UTC date in the format 'YYYY-MM-DD'.
|
public static
string
|
#
encodeDateTime( integer $datetime = false )
Returns a string containing the current UTC date and time in the format
prescribed by the Kolab Format Specification.
Returns a string containing the current UTC date and time in the format
prescribed by the Kolab Format Specification.
Parameters
- $datetime
- The integer representation of the date.
Returns
stringThe current UTC date and time in the format
'YYYY-MM-DDThh:mm:ssZ', where the T and Z are literal
characters.
|
public static
DateTime
|
#
readUtcDateTime( string $date_time )
Parse the provided string into a PHP DateTime object.
Parse the provided string into a PHP DateTime object.
Parameters
- $date_time
- The Kolab date-time value.
Returns
DateTime The date-time value represented as PHP DateTime object.
Since
Horde_Kolab_Format 1.1.0
|
public static
DateTime
|
#
readDate( string $date, string $timezone )
Parse the provided string into a PHP DateTime object.
Parse the provided string into a PHP DateTime object.
Parameters
- $date
- The Kolab date value.
- $timezone
- The associated timezone.
Returns
DateTime The date-time value represented as PHP DateTime object.
Since
Horde_Kolab_Format 1.1.0
|
public static
DateTime
|
#
readDateTime( string $date_time, string $timezone )
Parse the provided string into a PHP DateTime object.
Parse the provided string into a PHP DateTime object.
Parameters
- $date_time
- The Kolab date-time value.
- $timezone
- The associated timezone.
Returns
DateTime The date-time value represented as PHP DateTime object.
Since
Horde_Kolab_Format 1.1.0
|
public static
string
|
#
writeUtcDateTime( DateTime $date_time )
Write the provided PHP DateTime object into a Kolab format UTC date-time
representation.
Write the provided PHP DateTime object into a Kolab format UTC date-time
representation.
Parameters
- $date_time
- The PHP DateTime object.
Returns
string The Kolab format UTC date-time string.
Since
Horde_Kolab_Format 1.1.0
|
public static
string
|
#
writeDateTime( DateTime $date_time )
Write the provided PHP DateTime object into a Kolab format date-time
representation.
Write the provided PHP DateTime object into a Kolab format date-time
representation.
Parameters
- $date_time
- The PHP DateTime object.
Returns
string The Kolab format date-time string.
Since
Horde_Kolab_Format 1.1.0
|
public static
string
|
#
writeDate( DateTime $date )
Write the provided PHP DateTime object into a Kolab format date
representation.
Write the provided PHP DateTime object into a Kolab format date
representation.
Parameters
- $date
- The PHP DateTime object.
Returns
string The Kolab format UTC date string.
Since
Horde_Kolab_Format 1.1.0
|