Methods summary
public
Zend_Date
|
#
__construct( string|integer|Zend_Date |array $date = null, string $part = null, string|Zend_Locale $locale = null )
Generates the standard date object, could be a unix timestamp, localized
date, string, integer, array and so on. Also parts of dates or time are
supported Always set the default timezone: http://php.net/date_default_timezone_set
For example, in your bootstrap:
date_default_timezone_set('America/Los_Angeles'); For detailed instructions
please look in the docu.
Generates the standard date object, could be a unix timestamp, localized
date, string, integer, array and so on. Also parts of dates or time are
supported Always set the default timezone: http://php.net/date_default_timezone_set
For example, in your bootstrap:
date_default_timezone_set('America/Los_Angeles'); For detailed instructions
please look in the docu.
Parameters
- $date
string|integer|Zend_Date |array $date OPTIONAL Date value or value of date part to set ,depending on $part. If
null the actual time is set
- $part
string $part OPTIONAL Defines the input format of $date
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public static
Options
|
#
setOptions( array $options = array() )
Sets class wide options, if no option was given, the actual set options will
be returned
Sets class wide options, if no option was given, the actual set options will
be returned
Parameters
- $options
array $options Options to set
Returns
Options array if no option was given
Throws
Zend_Date_Exception
|
public
integer|string
|
#
getTimestamp( )
Returns this object's internal UNIX timestamp (equivalent to
Zend_Date::TIMESTAMP). If the timestamp is too large for integers, then the
return value will be a string. This function does not return the timestamp as an
object. Use clone() or copyPart() instead.
Returns this object's internal UNIX timestamp (equivalent to
Zend_Date::TIMESTAMP). If the timestamp is too large for integers, then the
return value will be a string. This function does not return the timestamp as an
object. Use clone() or copyPart() instead.
Returns
integer|string UNIX timestamp
|
private
Zend_Date |integer
|
#
_timestamp( string $calc, string|integer|array|Zend_Date $stamp )
Returns the calculated timestamp HINT: timestamps are always GMT
Returns the calculated timestamp HINT: timestamps are always GMT
Parameters
- $calc
string $calc Type of calculation to make
- $stamp
string|integer|array|Zend_Date $stamp Timestamp to calculate, when null the actual timestamp is calculated
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
setTimestamp( integer|string|array|Zend_Date $timestamp )
Sets a new timestamp
Parameters
- $timestamp
integer|string|array|Zend_Date $timestamp Timestamp to set
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addTimestamp( integer|string|array|Zend_Date $timestamp )
Adds a timestamp
Parameters
- $timestamp
integer|string|array|Zend_Date $timestamp Timestamp to add
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subTimestamp( integer|string|array|Zend_Date $timestamp )
Subtracts a timestamp
Parameters
- $timestamp
integer|string|array|Zend_Date $timestamp Timestamp to sub
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareTimestamp( integer|string|array|Zend_Date $timestamp )
Compares two timestamps, returning the difference as integer
Compares two timestamps, returning the difference as integer
Parameters
- $timestamp
integer|string|array|Zend_Date $timestamp Timestamp to compare
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
string
|
#
toString( string $format = null, string $type = null, string|Zend_Locale $locale = null )
Returns a string representation of the object Supported format tokens are: G
- era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d -
day of month E - day of week, e - number of weekday (1-7), h - hour 1-12, H -
hour 0-23, m - minute, s - second A - milliseconds of day, z - timezone, Z -
timezone offset, S - fractional second, a - period of day
Returns a string representation of the object Supported format tokens are: G
- era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d -
day of month E - day of week, e - number of weekday (1-7), h - hour 1-12, H -
hour 0-23, m - minute, s - second A - milliseconds of day, z - timezone, Z -
timezone offset, S - fractional second, a - period of day
Additionally format tokens but non ISO conform are: SS - day suffix, eee -
php number of weekday(0-6), ddd - number of days per month l - Leap year, B -
swatch internet time, I - daylight saving time, X - timezone offset in seconds r
- RFC2822 format, U - unix timestamp
Not supported ISO tokens are u - extended year, Q - quarter, q - quarter, L -
stand alone month, W - week of month F - day of week of month, g - modified
julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24 v - wall zone
Parameters
- $format
string $format OPTIONAL Rule for formatting output. If null the default date format is
used
- $type
string $type OPTIONAL Type for the format string which overrides the standard setting
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
string
|
public
string
|
#
__toString( )
Returns a string representation of the date which is equal with the
timestamp
Returns a string representation of the date which is equal with the
timestamp
Returns
string
|
public
integer|false
|
#
toValue( string|integer|Zend_Date $part = null )
Returns a integer representation of the object But returns false when the
given part is no value f.e. Month-Name
Returns a integer representation of the object But returns false when the
given part is no value f.e. Month-Name
Parameters
- $part
string|integer|Zend_Date $part OPTIONAL Defines the date or datepart to return as integer
Returns
integer|false
|
public
array
|
#
toArray( )
Returns an array representation of the object
Returns an array representation of the object
Returns
array
|
public
string
|
#
get( string $part = null, string|Zend_Locale $locale = null )
Returns a representation of a date or datepart This could be for example a
localized monthname, the time without date, the era or only the fractional
seconds. There are about 50 different supported date parts. For a complete list
of supported datepart values look into the docu
Returns a representation of a date or datepart This could be for example a
localized monthname, the time without date, the era or only the fractional
seconds. There are about 50 different supported date parts. For a complete list
of supported datepart values look into the docu
Parameters
- $part
string $part OPTIONAL Part of the date to return, if null the timestamp is returned
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
string date or datepart
|
private
string
|
#
_toToken( string $part, string $locale )
Internal method to apply tokens
Internal method to apply tokens
Parameters
- $part
string $part
- $locale
string $locale
Returns
string
|
private
string
|
#
_parseIsoToDate( string $token, string $locale )
Internal parsing method
Parameters
- $token
string $token
- $locale
string $locale
Returns
string
|
private
integer
|
#
_getDigitFromName( string $name )
Return digit from standard names (english) Faster implementation than locale
aware searching
Return digit from standard names (english) Faster implementation than locale
aware searching
Parameters
Returns
integer Number of this month
Throws
Zend_Date_Exception
|
public static
integer
|
#
getFullYear( integer $value )
Counts the exact year number < 70 - 2000 added, >70 < 100 - 1900,
others just returned
Counts the exact year number < 70 - 2000 added, >70 < 100 - 1900,
others just returned
Parameters
- $value
integer $value year number
Returns
integer Number of year
|
public
Zend_Date
|
#
set( string|integer|array|Zend_Date $date, string $part = null, string|Zend_Locale $locale = null )
Sets the given date as new date or a given datepart as new datepart returning
the new datepart This could be for example a localized dayname, the date without
time, the month or only the seconds. There are about 50 different supported date
parts. For a complete list of supported datepart values look into the docu
Sets the given date as new date or a given datepart as new datepart returning
the new datepart This could be for example a localized dayname, the date without
time, the month or only the seconds. There are about 50 different supported date
parts. For a complete list of supported datepart values look into the docu
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to set
- $part
string $part OPTIONAL Part of the date to set, if null the timestamp is set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
add( string|integer|array|Zend_Date $date, string $part = Zend_Date::TIMESTAMP , string|Zend_Locale $locale = null )
Adds a date or datepart to the existing date, by extracting $part from $date,
and modifying this object by adding that part. The $part is then extracted from
this object and returned as an integer or numeric string (for large values, or
$part's corresponding to pre-defined formatted date strings). This could be for
example a ISO 8601 date, the hour the monthname or only the minute. There are
about 50 different supported date parts. For a complete list of supported
datepart values look into the docu.
Adds a date or datepart to the existing date, by extracting $part from $date,
and modifying this object by adding that part. The $part is then extracted from
this object and returned as an integer or numeric string (for large values, or
$part's corresponding to pre-defined formatted date strings). This could be for
example a ISO 8601 date, the hour the monthname or only the minute. There are
about 50 different supported date parts. For a complete list of supported
datepart values look into the docu.
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to add
- $part
string $part OPTIONAL Part of the date to add, if null the timestamp is added
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
sub( string|integer|array|Zend_Date $date, string $part = Zend_Date::TIMESTAMP , string|Zend_Locale $locale = null )
Subtracts a date from another date. This could be for example a RFC2822 date,
the time, the year or only the timestamp. There are about 50 different supported
date parts. For a complete list of supported datepart values look into the docu
Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!!
Subtracts a date from another date. This could be for example a RFC2822 date,
the time, the year or only the timestamp. There are about 50 different supported
date parts. For a complete list of supported datepart values look into the docu
Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!!
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to subtract
- $part
string $part OPTIONAL Part of the date to sub, if null the timestamp is subtracted
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compare( string|integer|array|Zend_Date $date, string $part = Zend_Date::TIMESTAMP , string|Zend_Locale $locale = null )
Compares a date or datepart with the existing one. Returns -1 if earlier, 0
if equal and 1 if later.
Compares a date or datepart with the existing one. Returns -1 if earlier, 0
if equal and 1 if later.
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to compare with the date object
- $part
string $part OPTIONAL Part of the date to compare, if null the timestamp is subtracted
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
copyPart( string $part, string|Zend_Locale $locale = null )
Returns a new instance of Zend_Date with the selected part copied. To make an
exact copy, use PHP's clone keyword. For a complete list of supported date part
values look into the docu. If a date part is copied, all other date parts are
set to standard values. For example: If only YEAR is copied, the returned date
object is equal to 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to
timestamp 0) If only HOUR is copied, the returned date object is equal to
01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0
plus HOUR).
Returns a new instance of Zend_Date with the selected part copied. To make an
exact copy, use PHP's clone keyword. For a complete list of supported date part
values look into the docu. If a date part is copied, all other date parts are
set to standard values. For example: If only YEAR is copied, the returned date
object is equal to 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to
timestamp 0) If only HOUR is copied, the returned date object is equal to
01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0
plus HOUR).
Parameters
- $part
string $part Part of the date to compare, if null the timestamp is subtracted
- $locale
string|Zend_Locale $locale OPTIONAL New object's locale. No adjustments to timezone are made.
Returns
|
public
integer
|
#
getTimezoneFromString( string $zone )
Internal function, returns the offset of a given timezone
Internal function, returns the offset of a given timezone
Parameters
Returns
integer
|
private
integer|string|Zend_Date
|
#
_assign( string $calc, string|integer $date, string|integer $comp = 0, boolean|integer $dst = false )
Calculates the date or object
Calculates the date or object
Parameters
- $calc
string $calc Calculation to make
- $date
string|integer $date Date for calculation
- $comp
string|integer $comp Second date for calculation
- $dst
boolean|integer $dst Use dst correction if option is set
Returns
integer|string|Zend_Date new timestamp or Zend_Date depending on calculation
|
private
integer|string|Zend_Date
|
#
_calculate( string $calc, string|integer|array|Zend_Date $date, string $part, string|Zend_Locale $locale )
Calculates the date or object
Calculates the date or object
Parameters
- $calc
string $calc Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set'
- $date
string|integer|array|Zend_Date $date Date or datepart to calculate with
- $part
string $part Part of the date to calculate, if null the timestamp is used
- $locale
string|Zend_Locale $locale Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
boolean
|
#
equals( string|integer|array|Zend_Date $date, string $part = Zend_Date::TIMESTAMP , string|Zend_Locale $locale = null )
Returns true when both date objects or date parts are equal. For example:
15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will
return false
Returns true when both date objects or date parts are equal. For example:
15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will
return false
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to equal with
- $part
string $part OPTIONAL Part of the date to compare, if null the timestamp is used
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
boolean
Throws
Zend_Date_Exception
|
public
boolean
|
#
isEarlier( string|integer|array|Zend_Date $date, string $part = null, string|Zend_Locale $locale = null )
Returns if the given date or datepart is earlier For example: 15.May.2000
<-> 13.June.1999 will return true for day, year and date, but not for
month
Returns if the given date or datepart is earlier For example: 15.May.2000
<-> 13.June.1999 will return true for day, year and date, but not for
month
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to compare with
- $part
string $part OPTIONAL Part of the date to compare, if null the timestamp is used
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
boolean
Throws
Zend_Date_Exception
|
public
boolean
|
#
isLater( string|integer|array|Zend_Date $date, string $part = null, string|Zend_Locale $locale = null )
Returns if the given date or datepart is later For example: 15.May.2000
<-> 13.June.1999 will return true for month but false for day, year and
date Returns if the given date is later
Returns if the given date or datepart is later For example: 15.May.2000
<-> 13.June.1999 will return true for month but false for day, year and
date Returns if the given date is later
Parameters
- $date
string|integer|array|Zend_Date $date Date or datepart to compare with
- $part
string $part OPTIONAL Part of the date to compare, if null the timestamp is used
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
boolean
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getTime( string|Zend_Locale $locale = null )
Returns only the time of the date as new Zend_Date object For example:
15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23
Returns only the time of the date as new Zend_Date object For example:
15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
private
integer|Zend_Date
|
#
_time( string $calc, string|integer|array|Zend_Date $time, string $format, string|Zend_Locale $locale )
Returns the calculated time
Returns the calculated time
Parameters
- $calc
string $calc Calculation to make
- $time
string|integer|array|Zend_Date $time Time to calculate with, if null the actual time is taken
- $format
string $format Timeformat for parsing input
- $locale
string|Zend_Locale $locale Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
setTime( string|integer|array|Zend_Date $time, string $format = null, string|Zend_Locale $locale = null )
Sets a new time for the date object. Format defines how to parse the time
string. Also a complete date can be given, but only the time is used for
setting. For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44
sec => 1h11min44sec + 1 day Returned is the new date object and the existing
date is left as it was before
Sets a new time for the date object. Format defines how to parse the time
string. Also a complete date can be given, but only the time is used for
setting. For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44
sec => 1h11min44sec + 1 day Returned is the new date object and the existing
date is left as it was before
Parameters
- $time
string|integer|array|Zend_Date $time Time to set
- $format
string $format OPTIONAL Timeformat for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addTime( string|integer|array|Zend_Date $time, string $format = null, string|Zend_Locale $locale = null )
Adds a time to the existing date. Format defines how to parse the time
string. If only parts are given the other parts are set to 0. If no format is
given, the standardformat of this locale is used. For example: HH:mm:ss -> 10
-> +10 hours
Adds a time to the existing date. Format defines how to parse the time
string. If only parts are given the other parts are set to 0. If no format is
given, the standardformat of this locale is used. For example: HH:mm:ss -> 10
-> +10 hours
Parameters
- $time
string|integer|array|Zend_Date $time Time to add
- $format
string $format OPTIONAL Timeformat for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subTime( string|integer|array|Zend_Date $time, string $format = null, string|Zend_Locale $locale = null )
Subtracts a time from the existing date. Format defines how to parse the time
string. If only parts are given the other parts are set to 0. If no format is
given, the standardformat of this locale is used. For example: HH:mm:ss -> 10
-> -10 hours
Subtracts a time from the existing date. Format defines how to parse the time
string. If only parts are given the other parts are set to 0. If no format is
given, the standardformat of this locale is used. For example: HH:mm:ss -> 10
-> -10 hours
Parameters
- $time
string|integer|array|Zend_Date $time Time to sub
- $format
string $format OPTIONAL Timeformat for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareTime( string|integer|array|Zend_Date $time, string $format = null, string|Zend_Locale $locale = null )
Compares the time from the existing date. Format defines how to parse the
time string. If only parts are given the other parts are set to default. If no
format us given, the standardformat of this locale is used. For example:
HH:mm:ss -> 10 -> 10 hours
Compares the time from the existing date. Format defines how to parse the
time string. If only parts are given the other parts are set to default. If no
format us given, the standardformat of this locale is used. For example:
HH:mm:ss -> 10 -> 10 hours
Parameters
- $time
string|integer|array|Zend_Date $time Time to compare
- $format
string $format OPTIONAL Timeformat for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getDate( string|Zend_Locale $locale = null )
Returns a clone of $this, with the time part set to 00:00:00.
Returns a clone of $this, with the time part set to 00:00:00.
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
private
integer|Zend_Date
|
#
_date( string $calc, string|integer|array|Zend_Date $date, string $format, string|Zend_Locale $locale )
Returns the calculated date
Returns the calculated date
Parameters
- $calc
string $calc Calculation to make
- $date
string|integer|array|Zend_Date $date Date to calculate with, if null the actual date is taken
- $format
string $format Date format for parsing
- $locale
string|Zend_Locale $locale Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
setDate( string|integer|array|Zend_Date $date, string $format = null, string|Zend_Locale $locale = null )
Sets a new date for the date object. Format defines how to parse the date
string. Also a complete date with time can be given, but only the date is used
for setting. For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00
Returned is the new date object and the existing time is left as it was
before
Sets a new date for the date object. Format defines how to parse the date
string. Also a complete date with time can be given, but only the date is used
for setting. For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00
Returned is the new date object and the existing time is left as it was
before
Parameters
- $date
string|integer|array|Zend_Date $date Date to set
- $format
string $format OPTIONAL Date format for parsing
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addDate( string|integer|array|Zend_Date $date, string $format = null, string|Zend_Locale $locale = null )
Adds a date to the existing date object. Format defines how to parse the date
string. If only parts are given the other parts are set to 0. If no format is
given, the standardformat of this locale is used. For example: MM.dd.YYYY ->
10 -> +10 months
Adds a date to the existing date object. Format defines how to parse the date
string. If only parts are given the other parts are set to 0. If no format is
given, the standardformat of this locale is used. For example: MM.dd.YYYY ->
10 -> +10 months
Parameters
- $date
string|integer|array|Zend_Date $date Date to add
- $format
string $format OPTIONAL Date format for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subDate( string|integer|array|Zend_Date $date, string $format = null, string|Zend_Locale $locale = null )
Subtracts a date from the existing date object. Format defines how to parse
the date string. If only parts are given the other parts are set to 0. If no
format is given, the standardformat of this locale is used. For example:
MM.dd.YYYY -> 10 -> -10 months Be aware: Subtracting 2 months is not equal
to Adding -2 months !!!
Subtracts a date from the existing date object. Format defines how to parse
the date string. If only parts are given the other parts are set to 0. If no
format is given, the standardformat of this locale is used. For example:
MM.dd.YYYY -> 10 -> -10 months Be aware: Subtracting 2 months is not equal
to Adding -2 months !!!
Parameters
- $date
string|integer|array|Zend_Date $date Date to sub
- $format
string $format OPTIONAL Date format for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareDate( string|integer|array|Zend_Date $date, string $format = null, string|Zend_Locale $locale = null )
Compares the date from the existing date object, ignoring the time. Format
defines how to parse the date string. If only parts are given the other parts
are set to 0. If no format is given, the standardformat of this locale is used.
For example: 10.01.2000 => 10.02.1999 -> false
Compares the date from the existing date object, ignoring the time. Format
defines how to parse the date string. If only parts are given the other parts
are set to 0. If no format is given, the standardformat of this locale is used.
For example: 10.01.2000 => 10.02.1999 -> false
Parameters
- $date
string|integer|array|Zend_Date $date Date to compare
- $format
string $format OPTIONAL Date format for parsing input
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
string
|
#
getIso( string|Zend_Locale $locale = null )
Returns the full ISO 8601 date from the date object. Always the complete ISO
8601 specifiction is used. If an other ISO date is needed (ISO 8601 defines
several formats) use toString() instead. This function does not return the ISO
date as object. Use copy() instead.
Returns the full ISO 8601 date from the date object. Always the complete ISO
8601 specifiction is used. If an other ISO date is needed (ISO 8601 defines
several formats) use toString() instead. This function does not return the ISO
date as object. Use copy() instead.
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
string
|
public
Zend_Date
|
#
setIso( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Sets a new date for the date object. Not given parts are set to default. Only
supported ISO 8601 formats are accepted. For example: 050901 -> 01.Sept.2005
00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s Returned is the new date
object
Sets a new date for the date object. Not given parts are set to default. Only
supported ISO 8601 formats are accepted. For example: 050901 -> 01.Sept.2005
00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s Returned is the new date
object
Parameters
- $date
string|integer|Zend_Date $date ISO Date to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addIso( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Adds a ISO date to the date object. Not given parts are set to default. Only
supported ISO 8601 formats are accepted. For example: 050901 -> +
01.Sept.2005 00:00:00, 10:00:00 -> +10h Returned is the new date object
Adds a ISO date to the date object. Not given parts are set to default. Only
supported ISO 8601 formats are accepted. For example: 050901 -> +
01.Sept.2005 00:00:00, 10:00:00 -> +10h Returned is the new date object
Parameters
- $date
string|integer|Zend_Date $date ISO Date to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subIso( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Subtracts a ISO date from the date object. Not given parts are set to
default. Only supported ISO 8601 formats are accepted. For example: 050901 ->
- 01.Sept.2005 00:00:00, 10:00:00 -> -10h Returned is the new date object
Subtracts a ISO date from the date object. Not given parts are set to
default. Only supported ISO 8601 formats are accepted. For example: 050901 ->
- 01.Sept.2005 00:00:00, 10:00:00 -> -10h Returned is the new date object
Parameters
- $date
string|integer|Zend_Date $date ISO Date to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareIso( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Compares a ISO date with the date object. Not given parts are set to default.
Only supported ISO 8601 formats are accepted. For example: 050901 -> -
01.Sept.2005 00:00:00, 10:00:00 -> -10h Returns if equal, earlier or
later
Compares a ISO date with the date object. Not given parts are set to default.
Only supported ISO 8601 formats are accepted. For example: 050901 -> -
01.Sept.2005 00:00:00, 10:00:00 -> -10h Returns if equal, earlier or
later
Parameters
- $date
string|integer|Zend_Date $date ISO Date to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
string
|
#
getArpa( string|Zend_Locale $locale = null )
Returns a RFC 822 compilant datestring from the date object. This function
does not return the RFC date as object. Use copy() instead.
Returns a RFC 822 compilant datestring from the date object. This function
does not return the RFC date as object. Use copy() instead.
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
string
|
public
Zend_Date
|
#
setArpa( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Sets a RFC 822 date as new date for the date object. Only RFC 822 compilant
date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returned
is the new date object
Sets a RFC 822 date as new date for the date object. Only RFC 822 compilant
date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returned
is the new date object
Parameters
- $date
string|integer|Zend_Date $date RFC 822 to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addArpa( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Adds a RFC 822 date to the date object. ARPA messages are used in emails or
HTTP Headers. Only RFC 822 compilant date strings are accepted. For example:
Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object
Adds a RFC 822 date to the date object. ARPA messages are used in emails or
HTTP Headers. Only RFC 822 compilant date strings are accepted. For example:
Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object
Parameters
- $date
string|integer|Zend_Date $date RFC 822 Date to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subArpa( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Subtracts a RFC 822 date from the date object. ARPA messages are used in
emails or HTTP Headers. Only RFC 822 compilant date strings are accepted. For
example: Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object
Subtracts a RFC 822 date from the date object. ARPA messages are used in
emails or HTTP Headers. Only RFC 822 compilant date strings are accepted. For
example: Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object
Parameters
- $date
string|integer|Zend_Date $date RFC 822 Date to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareArpa( string|integer|Zend_Date $date, string|Zend_Locale $locale = null )
Compares a RFC 822 compilant date with the date object. ARPA messages are
used in emails or HTTP Headers. Only RFC 822 compilant date strings are
accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returns if equal, earlier
or later
Compares a RFC 822 compilant date with the date object. ARPA messages are
used in emails or HTTP Headers. Only RFC 822 compilant date strings are
accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returns if equal, earlier
or later
Parameters
- $date
string|integer|Zend_Date $date RFC 822 Date to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
private
mixed
|
#
_checkLocation( mixed $location )
Check if location is supported
Check if location is supported
Parameters
- $location
mixed $location array - locations array
Returns
mixed $horizon float
|
public
Zend_Date
|
#
getSunrise( mixed $location )
Returns the time of sunrise for this date and a given location as new date
object For a list of cities and correct locations use the class
Zend_Date_Cities
Returns the time of sunrise for this date and a given location as new date
object For a list of cities and correct locations use the class
Zend_Date_Cities
Parameters
- $location
mixed $location array - location of sunrise ['horizon'] -> civil, nautic,
astronomical, effective (default) ['longitude'] -> longitude of location
['latitude'] -> latitude of location
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getSunset( mixed $location )
Returns the time of sunset for this date and a given location as new date
object For a list of cities and correct locations use the class
Zend_Date_Cities
Returns the time of sunset for this date and a given location as new date
object For a list of cities and correct locations use the class
Zend_Date_Cities
Parameters
- $location
mixed $location array - location of sunset ['horizon'] -> civil, nautic,
astronomical, effective (default) ['longitude'] -> longitude of location
['latitude'] -> latitude of location
Returns
Throws
Zend_Date_Exception
|
public
array
|
#
getSunInfo( mixed $location )
Returns an array with the sunset and sunrise dates for all horizon types For
a list of cities and correct locations use the class Zend_Date_Cities
Returns an array with the sunset and sunrise dates for all horizon types For
a list of cities and correct locations use the class Zend_Date_Cities
Parameters
- $location
mixed $location array - location of suninfo ['horizon'] -> civil, nautic,
astronomical, effective (default) ['longitude'] -> longitude of location
['latitude'] -> latitude of location
Returns
array - [sunset|sunrise][effective|civil|nautic|astronomic]
Throws
Zend_Date_Exception
|
public static
boolean
|
#
checkLeapYear( integer|array|Zend_Date $year )
Check a given year for leap year.
Check a given year for leap year.
Parameters
- $year
integer|array|Zend_Date $year Year to check
Returns
boolean
|
public
boolean
|
#
isLeapYear( )
Returns true, if the year is a leap year.
Returns true, if the year is a leap year.
Returns
boolean
|
public
boolean
|
#
isToday( )
Returns if the set date is todays date
Returns if the set date is todays date
Returns
boolean
|
public
boolean
|
#
isYesterday( )
Returns if the set date is yesterdays date
Returns if the set date is yesterdays date
Returns
boolean
|
public
boolean
|
#
isTomorrow( )
Returns if the set date is tomorrows date
Returns if the set date is tomorrows date
Returns
boolean
|
public static
Zend_Date
|
#
now( string|Zend_Locale $locale = null )
Returns the actual date as new date object
Returns the actual date as new date object
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
private
integer|string
|
#
_calcdetail( string $calc, string|integer|array|Zend_Date $date, string $type, string|Zend_Locale $locale )
Calculate date details
Parameters
- $calc
string $calc Calculation to make
- $date
string|integer|array|Zend_Date $date Date or Part to calculate
- $type
string $part Datepart for Calculation
- $locale
string|Zend_Locale $locale Locale for parsing input
Returns
integer|string new date
Throws
Zend_Date_Exception
|
private
integer|Zend_Date
|
#
_calcvalue( string $calc, string|integer|Zend_Date $value, string|Zend_Locale $type, mixed $parameter, mixed $locale )
Internal calculation, returns the requested date type
Internal calculation, returns the requested date type
Parameters
- $calc
string $calc Calculation to make
- $value
string|integer|Zend_Date $value Datevalue to calculate with, if null the actual value is taken
- $type
string|Zend_Locale $locale Locale for parsing input
- $parameter
- $locale
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getYear( string|Zend_Locale $locale = null )
Returns only the year from the date object as new object. For example:
10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00
Returns only the year from the date object as new object. For example:
10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
public
Zend_Date
|
#
setYear( string|integer|array|Zend_Date $year, string|Zend_Locale $locale = null )
Sets a new year If the year is between 0 and 69, 2000 will be set (2000-2069)
If the year if between 70 and 99, 1999 will be set (1970-1999) 3 or 4 digit
years are set as expected. If you need to set year 0-99 use set() instead.
Returned is the new date object
Sets a new year If the year is between 0 and 69, 2000 will be set (2000-2069)
If the year if between 70 and 99, 1999 will be set (1970-1999) 3 or 4 digit
years are set as expected. If you need to set year 0-99 use set() instead.
Returned is the new date object
Parameters
- $year
string|integer|array|Zend_Date $date Year to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addYear( string|integer|array|Zend_Date $year, string|Zend_Locale $locale = null )
Adds the year to the existing date object If the year is between 0 and 69,
2000 will be added (2000-2069) If the year if between 70 and 99, 1999 will be
added (1970-1999) 3 or 4 digit years are added as expected. If you need to add
years from 0-99 use add() instead. Returned is the new date object
Adds the year to the existing date object If the year is between 0 and 69,
2000 will be added (2000-2069) If the year if between 70 and 99, 1999 will be
added (1970-1999) 3 or 4 digit years are added as expected. If you need to add
years from 0-99 use add() instead. Returned is the new date object
Parameters
- $year
string|integer|array|Zend_Date $date Year to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subYear( string|integer|array|Zend_Date $year, string|Zend_Locale $locale = null )
Subs the year from the existing date object If the year is between 0 and 69,
2000 will be subtracted (2000-2069) If the year if between 70 and 99, 1999 will
be subtracted (1970-1999) 3 or 4 digit years are subtracted as expected. If you
need to subtract years from 0-99 use sub() instead. Returned is the new date
object
Subs the year from the existing date object If the year is between 0 and 69,
2000 will be subtracted (2000-2069) If the year if between 70 and 99, 1999 will
be subtracted (1970-1999) 3 or 4 digit years are subtracted as expected. If you
need to subtract years from 0-99 use sub() instead. Returned is the new date
object
Parameters
- $year
string|integer|array|Zend_Date $date Year to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareYear( string|integer|array|Zend_Date $year, string|Zend_Locale $locale = null )
Compares the year with the existing date object, ignoring other date parts.
For example: 10.03.2000 -> 15.02.2000 -> true Returns if equal, earlier or
later
Compares the year with the existing date object, ignoring other date parts.
For example: 10.03.2000 -> 15.02.2000 -> true Returns if equal, earlier or
later
Parameters
- $year
string|integer|array|Zend_Date $year Year to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getMonth( string|Zend_Locale $locale = null )
Returns only the month from the date object as new object. For example:
10.May.2000 10:30:00 -> 01.May.1970 00:00:00
Returns only the month from the date object as new object. For example:
10.May.2000 10:30:00 -> 01.May.1970 00:00:00
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
private
integer|Zend_Date
|
#
_month( string $calc, string|integer|array|Zend_Date $month, string|Zend_Locale $locale )
Returns the calculated month
Returns the calculated month
Parameters
- $calc
string $calc Calculation to make
- $month
string|integer|array|Zend_Date $month Month to calculate with, if null the actual month is taken
- $locale
string|Zend_Locale $locale Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
setMonth( string|integer|array|Zend_Date $month, string|Zend_Locale $locale = null )
Sets a new month The month can be a number or a string. Setting months lower
then 0 and greater then 12 will result in adding or subtracting the relevant
year. (12 months equal one year) If a localized monthname is given it will be
parsed with the default locale or the optional set locale. Returned is the new
date object
Sets a new month The month can be a number or a string. Setting months lower
then 0 and greater then 12 will result in adding or subtracting the relevant
year. (12 months equal one year) If a localized monthname is given it will be
parsed with the default locale or the optional set locale. Returned is the new
date object
Parameters
- $month
string|integer|array|Zend_Date $month Month to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addMonth( string|integer|array|Zend_Date $month, string|Zend_Locale $locale = null )
Adds months to the existing date object. The month can be a number or a
string. Adding months lower then 0 and greater then 12 will result in adding or
subtracting the relevant year. (12 months equal one year) If a localized
monthname is given it will be parsed with the default locale or the optional set
locale. Returned is the new date object
Adds months to the existing date object. The month can be a number or a
string. Adding months lower then 0 and greater then 12 will result in adding or
subtracting the relevant year. (12 months equal one year) If a localized
monthname is given it will be parsed with the default locale or the optional set
locale. Returned is the new date object
Parameters
- $month
string|integer|array|Zend_Date $month Month to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subMonth( string|integer|array|Zend_Date $month, string|Zend_Locale $locale = null )
Subtracts months from the existing date object. The month can be a number or
a string. Subtracting months lower then 0 and greater then 12 will result in
adding or subtracting the relevant year. (12 months equal one year) If a
localized monthname is given it will be parsed with the default locale or the
optional set locale. Returned is the new date object
Subtracts months from the existing date object. The month can be a number or
a string. Subtracting months lower then 0 and greater then 12 will result in
adding or subtracting the relevant year. (12 months equal one year) If a
localized monthname is given it will be parsed with the default locale or the
optional set locale. Returned is the new date object
Parameters
- $month
string|integer|array|Zend_Date $month Month to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareMonth( string|integer|array|Zend_Date $month, string|Zend_Locale $locale = null )
Compares the month with the existing date object, ignoring other date parts.
For example: 10.03.2000 -> 15.03.1950 -> true Returns if equal, earlier or
later
Compares the month with the existing date object, ignoring other date parts.
For example: 10.03.2000 -> 15.03.1950 -> true Returns if equal, earlier or
later
Parameters
- $month
string|integer|array|Zend_Date $month Month to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getDay( mixed $locale = null )
Returns the day as new date object Example: 20.May.1986 -> 20.Jan.1970
00:00:00
Returns the day as new date object Example: 20.May.1986 -> 20.Jan.1970
00:00:00
Parameters
- $locale
mixed $locale string|Zend_Locale OPTIONAL Locale for parsing input
Returns
|
private
Zend_Date |integer
|
#
_day( mixed $calc, mixed $day, mixed $locale )
Returns the calculated day
Returns the calculated day
Parameters
- $calc
mixed $calc string Type of calculation to make
- $day
mixed $day string|integer|Zend_Date Day to calculate, when null the actual day is
calculated
- $locale
mixed $locale string|Zend_Locale Locale for parsing input
Returns
|
public
Zend_Date
|
#
setDay( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Sets a new day The day can be a number or a string. Setting days lower then 0
or greater than the number of this months days will result in adding or
subtracting the relevant month. If a localized dayname is given it will be
parsed with the default locale or the optional set locale. Returned is the new
date object Example: setDay('Montag', 'de_AT'); will set the monday of this week
as day.
Sets a new day The day can be a number or a string. Setting days lower then 0
or greater than the number of this months days will result in adding or
subtracting the relevant month. If a localized dayname is given it will be
parsed with the default locale or the optional set locale. Returned is the new
date object Example: setDay('Montag', 'de_AT'); will set the monday of this week
as day.
Parameters
- $day
string|integer|array|Zend_Date $month Day to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addDay( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Adds days to the existing date object. The day can be a number or a string.
Adding days lower then 0 or greater than the number of this months days will
result in adding or subtracting the relevant month. If a localized dayname is
given it will be parsed with the default locale or the optional set locale.
Adds days to the existing date object. The day can be a number or a string.
Adding days lower then 0 or greater than the number of this months days will
result in adding or subtracting the relevant month. If a localized dayname is
given it will be parsed with the default locale or the optional set locale.
Parameters
- $day
string|integer|array|Zend_Date $month Day to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subDay( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Subtracts days from the existing date object. The day can be a number or a
string. Subtracting days lower then 0 or greater than the number of this months
days will result in adding or subtracting the relevant month. If a localized
dayname is given it will be parsed with the default locale or the optional set
locale.
Subtracts days from the existing date object. The day can be a number or a
string. Subtracting days lower then 0 or greater than the number of this months
days will result in adding or subtracting the relevant month. If a localized
dayname is given it will be parsed with the default locale or the optional set
locale.
Parameters
- $day
string|integer|array|Zend_Date $month Day to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareDay( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Compares the day with the existing date object, ignoring other date parts.
For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier
or later
Compares the day with the existing date object, ignoring other date parts.
For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier
or later
Parameters
- $day
string|integer|array|Zend_Date $day Day to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getWeekday( mixed $locale = null )
Returns the weekday as new date object Weekday is always from 1-7 Example:
09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also
Tuesday)
Returns the weekday as new date object Weekday is always from 1-7 Example:
09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also
Tuesday)
Parameters
- $locale
mixed $locale string|Zend_Locale OPTIONAL Locale for parsing input
Returns
|
private
Zend_Date |integer
|
#
_weekday( mixed $calc, mixed $weekday, mixed $locale )
Returns the calculated weekday
Returns the calculated weekday
Parameters
- $calc
mixed $calc string Type of calculation to make
- $weekday
mixed $weekday string|integer|array|Zend_Date Weekday to calculate, when null the
actual weekday is calculated
- $locale
mixed $locale string|Zend_Locale Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
setWeekday( string|integer|array|Zend_Date $weekday, string|Zend_Locale $locale = null )
Sets a new weekday The weekday can be a number or a string. If a localized
weekday name is given, then it will be parsed as a date in $locale (defaults to
the same locale as $this). Returned is the new date object. Example:
setWeekday(3); will set the wednesday of this week as day.
Sets a new weekday The weekday can be a number or a string. If a localized
weekday name is given, then it will be parsed as a date in $locale (defaults to
the same locale as $this). Returned is the new date object. Example:
setWeekday(3); will set the wednesday of this week as day.
Parameters
- $weekday
string|integer|array|Zend_Date $month Weekday to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addWeekday( string|integer|array|Zend_Date $weekday, string|Zend_Locale $locale = null )
Adds weekdays to the existing date object. The weekday can be a number or a
string. If a localized dayname is given it will be parsed with the default
locale or the optional set locale. Returned is the new date object Example:
addWeekday(3); will add the difference of days from the begining of the month
until wednesday.
Adds weekdays to the existing date object. The weekday can be a number or a
string. If a localized dayname is given it will be parsed with the default
locale or the optional set locale. Returned is the new date object Example:
addWeekday(3); will add the difference of days from the begining of the month
until wednesday.
Parameters
- $weekday
string|integer|array|Zend_Date $month Weekday to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subWeekday( string|integer|array|Zend_Date $weekday, string|Zend_Locale $locale = null )
Subtracts weekdays from the existing date object. The weekday can be a number
or a string. If a localized dayname is given it will be parsed with the default
locale or the optional set locale. Returned is the new date object Example:
subWeekday(3); will subtract the difference of days from the begining of the
month until wednesday.
Subtracts weekdays from the existing date object. The weekday can be a number
or a string. If a localized dayname is given it will be parsed with the default
locale or the optional set locale. Returned is the new date object Example:
subWeekday(3); will subtract the difference of days from the begining of the
month until wednesday.
Parameters
- $weekday
string|integer|array|Zend_Date $month Weekday to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareWeekday( string|integer|array|Zend_Date $weekday, string|Zend_Locale $locale = null )
Compares the weekday with the existing date object, ignoring other date
parts. For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal,
earlier or later
Compares the weekday with the existing date object, ignoring other date
parts. For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal,
earlier or later
Parameters
- $weekday
string|integer|array|Zend_Date $weekday Weekday to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getDayOfYear( string|Zend_Locale $locale = null )
Returns the day of year as new date object Example: 02.Feb.1986 10:00:00
-> 02.Feb.1970 00:00:00
Returns the day of year as new date object Example: 02.Feb.1986 10:00:00
-> 02.Feb.1970 00:00:00
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
public
Zend_Date
|
#
setDayOfYear( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Sets a new day of year The day of year is always a number. Returned is the
new date object Example: 04.May.2004 -> setDayOfYear(10) ->
10.Jan.2004
Sets a new day of year The day of year is always a number. Returned is the
new date object Example: 04.May.2004 -> setDayOfYear(10) ->
10.Jan.2004
Parameters
- $day
string|integer|array|Zend_Date $day Day of Year to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addDayOfYear( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Adds a day of year to the existing date object. The day of year is always a
number. Returned is the new date object Example: addDayOfYear(10); will add 10
days to the existing date object.
Adds a day of year to the existing date object. The day of year is always a
number. Returned is the new date object Example: addDayOfYear(10); will add 10
days to the existing date object.
Parameters
- $day
string|integer|array|Zend_Date $day Day of Year to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subDayOfYear( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Subtracts a day of year from the existing date object. The day of year is
always a number. Returned is the new date object Example: subDayOfYear(10); will
subtract 10 days from the existing date object.
Subtracts a day of year from the existing date object. The day of year is
always a number. Returned is the new date object Example: subDayOfYear(10); will
subtract 10 days from the existing date object.
Parameters
- $day
string|integer|array|Zend_Date $day Day of Year to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareDayOfYear( string|integer|array|Zend_Date $day, string|Zend_Locale $locale = null )
Compares the day of year with the existing date object. For example:
compareDayOfYear(33) -> 02.Feb.2007 -> 0 Returns if equal, earlier or
later
Compares the day of year with the existing date object. For example:
compareDayOfYear(33) -> 02.Feb.2007 -> 0 Returns if equal, earlier or
later
Parameters
- $day
string|integer|array|Zend_Date $day Day of Year to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getHour( mixed $locale = null )
Returns the hour as new date object Example: 02.Feb.1986 10:30:25 ->
01.Jan.1970 10:00:00
Returns the hour as new date object Example: 02.Feb.1986 10:30:25 ->
01.Jan.1970 10:00:00
Parameters
- $locale
mixed $locale string|Zend_Locale OPTIONAL Locale for parsing input
Returns
|
public
Zend_Date
|
#
setHour( string|integer|array|Zend_Date $hour, string|Zend_Locale $locale = null )
Sets a new hour The hour is always a number. Returned is the new date object
Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25
Sets a new hour The hour is always a number. Returned is the new date object
Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25
Parameters
- $hour
string|integer|array|Zend_Date $hour Hour to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addHour( string|integer|array|Zend_Date $hour, string|Zend_Locale $locale = null )
Adds hours to the existing date object. The hour is always a number. Returned
is the new date object Example: 04.May.1993 13:07:25 -> addHour(12); ->
05.May.1993 01:07:25
Adds hours to the existing date object. The hour is always a number. Returned
is the new date object Example: 04.May.1993 13:07:25 -> addHour(12); ->
05.May.1993 01:07:25
Parameters
- $hour
string|integer|array|Zend_Date $hour Hour to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subHour( string|integer|array|Zend_Date $hour, string|Zend_Locale $locale = null )
Subtracts hours from the existing date object. The hour is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 -> subHour(6);
-> 05.May.1993 07:07:25
Subtracts hours from the existing date object. The hour is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 -> subHour(6);
-> 05.May.1993 07:07:25
Parameters
- $hour
string|integer|array|Zend_Date $hour Hour to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareHour( string|integer|array|Zend_Date $hour, string|Zend_Locale $locale = null )
Compares the hour with the existing date object. For example: 10:30:25 ->
compareHour(10) -> 0 Returns if equal, earlier or later
Compares the hour with the existing date object. For example: 10:30:25 ->
compareHour(10) -> 0 Returns if equal, earlier or later
Parameters
- $hour
string|integer|array|Zend_Date $hour Hour to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getMinute( string|Zend_Locale $locale = null )
Returns the minute as new date object Example: 02.Feb.1986 10:30:25 ->
01.Jan.1970 00:30:00
Returns the minute as new date object Example: 02.Feb.1986 10:30:25 ->
01.Jan.1970 00:30:00
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
public
Zend_Date
|
#
setMinute( string|integer|array|Zend_Date $minute, string|Zend_Locale $locale = null )
Sets a new minute The minute is always a number. Returned is the new date
object Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993
13:29:25
Sets a new minute The minute is always a number. Returned is the new date
object Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993
13:29:25
Parameters
- $minute
string|integer|array|Zend_Date $minute Minute to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addMinute( string|integer|array|Zend_Date $minute, string|Zend_Locale $locale = null )
Adds minutes to the existing date object. The minute is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 ->
addMinute(65); -> 04.May.1993 13:12:25
Adds minutes to the existing date object. The minute is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 ->
addMinute(65); -> 04.May.1993 13:12:25
Parameters
- $minute
string|integer|array|Zend_Date $minute Minute to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subMinute( string|integer|array|Zend_Date $minute, string|Zend_Locale $locale = null )
Subtracts minutes from the existing date object. The minute is always a
number. Returned is the new date object Example: 04.May.1993 13:07:25 ->
subMinute(9); -> 04.May.1993 12:58:25
Subtracts minutes from the existing date object. The minute is always a
number. Returned is the new date object Example: 04.May.1993 13:07:25 ->
subMinute(9); -> 04.May.1993 12:58:25
Parameters
- $minute
string|integer|array|Zend_Date $minute Minute to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareMinute( string|integer|array|Zend_Date $minute, string|Zend_Locale $locale = null )
Compares the minute with the existing date object. For example: 10:30:25
-> compareMinute(30) -> 0 Returns if equal, earlier or later
Compares the minute with the existing date object. For example: 10:30:25
-> compareMinute(30) -> 0 Returns if equal, earlier or later
Parameters
- $minute
string|integer|array|Zend_Date $minute Hour to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
getSecond( string|Zend_Locale $locale = null )
Returns the second as new date object Example: 02.Feb.1986 10:30:25 ->
01.Jan.1970 00:00:25
Returns the second as new date object Example: 02.Feb.1986 10:30:25 ->
01.Jan.1970 00:00:25
Parameters
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
|
public
Zend_Date
|
#
setSecond( string|integer|array|Zend_Date $second, string|Zend_Locale $locale = null )
Sets new seconds to the existing date object. The second is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 ->
setSecond(100); -> 04.May.1993 13:08:40
Sets new seconds to the existing date object. The second is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 ->
setSecond(100); -> 04.May.1993 13:08:40
Parameters
- $second
string|integer|array|Zend_Date $second Second to set
- $locale
string|Zend_Locale $locale (Optional) Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addSecond( string|integer|array|Zend_Date $second, string|Zend_Locale $locale = null )
Adds seconds to the existing date object. The second is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 ->
addSecond(65); -> 04.May.1993 13:08:30
Adds seconds to the existing date object. The second is always a number.
Returned is the new date object Example: 04.May.1993 13:07:25 ->
addSecond(65); -> 04.May.1993 13:08:30
Parameters
- $second
string|integer|array|Zend_Date $second Second to add
- $locale
string|Zend_Locale $locale (Optional) Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subSecond( string|integer|array|Zend_Date $second, string|Zend_Locale $locale = null )
Subtracts seconds from the existing date object. The second is always a
number. Returned is the new date object Example: 04.May.1993 13:07:25 ->
subSecond(10); -> 04.May.1993 13:07:15
Subtracts seconds from the existing date object. The second is always a
number. Returned is the new date object Example: 04.May.1993 13:07:25 ->
subSecond(10); -> 04.May.1993 13:07:15
Parameters
- $second
string|integer|array|Zend_Date $second Second to sub
- $locale
string|Zend_Locale $locale (Optional) Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareSecond( string|integer|array|Zend_Date $second, string|Zend_Locale $locale = null )
Compares the second with the existing date object. For example: 10:30:25
-> compareSecond(25) -> 0 Returns if equal, earlier or later
Compares the second with the existing date object. For example: 10:30:25
-> compareSecond(25) -> 0 Returns if equal, earlier or later
Parameters
- $second
string|integer|array|Zend_Date $second Second to compare
- $locale
string|Zend_Locale $locale (Optional) Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception
|
public
integer
|
#
getFractionalPrecision( )
Returns the precision for fractional seconds
Returns the precision for fractional seconds
Returns
integer
|
public
Zend_Date
|
#
setFractionalPrecision( integer $precision )
Sets a new precision for fractional seconds
Sets a new precision for fractional seconds
Parameters
- $precision
integer $precision Precision for the fractional datepart 3 = milliseconds
Returns
Throws
Zend_Date_Exception
|
public
string
|
#
getMilliSecond( )
Returns the milliseconds of the date object
Returns the milliseconds of the date object
Returns
string
|
public
Zend_Date
|
#
setMilliSecond( integer|Zend_Date $milli = null, integer $precision = null )
Sets new milliseconds for the date object Example: setMilliSecond(550, 2)
-> equals +5 Sec +50 MilliSec
Sets new milliseconds for the date object Example: setMilliSecond(550, 2)
-> equals +5 Sec +50 MilliSec
Parameters
- $milli
integer|Zend_Date $milli (Optional) Millisecond to set, when null the actual millisecond is set
- $precision
integer $precision (Optional) Fraction precision of the given milliseconds
Returns
|
public
Zend_Date
|
#
addMilliSecond( integer|Zend_Date $milli = null, integer $precision = null )
Adds milliseconds to the date object
Adds milliseconds to the date object
Parameters
- $milli
integer|Zend_Date $milli (Optional) Millisecond to add, when null the actual millisecond is added
- $precision
integer $precision (Optional) Fractional precision for the given milliseconds
Returns
|
public
Zend_Date
|
#
subMilliSecond( integer|Zend_Date $milli = null, integer $precision = null )
Subtracts a millisecond
Parameters
- $milli
integer|Zend_Date $milli (Optional) Millisecond to sub, when null the actual millisecond is
subtracted
- $precision
integer $precision (Optional) Fractional precision for the given milliseconds
Returns
|
public
integer
|
#
compareMilliSecond( integer|Zend_Date $milli = null, integer $precision = null )
Compares only the millisecond part, returning the difference
Compares only the millisecond part, returning the difference
Parameters
- $milli
integer|Zend_Date $milli OPTIONAL Millisecond to compare, when null the actual millisecond is
compared
- $precision
integer $precision OPTIONAL Fractional precision for the given milliseconds
Returns
integer 0 = equal, 1 = later, -1 = earlier
Throws
Zend_Date_Exception On invalid input
|
public
Zend_Date
|
#
getWeek( mixed $locale = null )
Returns the week as new date object using monday as begining of the week
Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00
Returns the week as new date object using monday as begining of the week
Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00
Parameters
- $locale
mixed $locale string|Zend_Locale OPTIONAL Locale for parsing input
Returns
|
public
Zend_Date
|
#
setWeek( string|integer|array|Zend_Date $week, string|Zend_Locale $locale = null )
Sets a new week. The week is always a number. The day of week is not changed.
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> setWeek(1);
-> 02.Jan.2007 13:07:25
Sets a new week. The week is always a number. The day of week is not changed.
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> setWeek(1);
-> 02.Jan.2007 13:07:25
Parameters
- $week
string|integer|array|Zend_Date $week Week to set
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
addWeek( string|integer|array|Zend_Date $week, string|Zend_Locale $locale = null )
Adds a week. The week is always a number. The day of week is not changed.
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> addWeek(1);
-> 16.Jan.2007 13:07:25
Adds a week. The week is always a number. The day of week is not changed.
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> addWeek(1);
-> 16.Jan.2007 13:07:25
Parameters
- $week
string|integer|array|Zend_Date $week Week to add
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
Zend_Date
|
#
subWeek( string|integer|array|Zend_Date $week, string|Zend_Locale $locale = null )
Subtracts a week. The week is always a number. The day of week is not
changed. Returned is the new date object Example: 09.Jan.2007 13:07:25 ->
subWeek(1); -> 02.Jan.2007 13:07:25
Subtracts a week. The week is always a number. The day of week is not
changed. Returned is the new date object Example: 09.Jan.2007 13:07:25 ->
subWeek(1); -> 02.Jan.2007 13:07:25
Parameters
- $week
string|integer|array|Zend_Date $week Week to sub
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
Throws
Zend_Date_Exception
|
public
integer
|
#
compareWeek( string|integer|array|Zend_Date $week, string|Zend_Locale $locale = null )
Compares only the week part, returning the difference Returned is the new
date object Returns if equal, earlier or later Example: 09.Jan.2007 13:07:25
-> compareWeek(2); -> 0
Compares only the week part, returning the difference Returned is the new
date object Returns if equal, earlier or later Example: 09.Jan.2007 13:07:25
-> compareWeek(2); -> 0
Parameters
- $week
string|integer|array|Zend_Date $week Week to compare
- $locale
string|Zend_Locale $locale OPTIONAL Locale for parsing input
Returns
integer 0 = equal, 1 = later, -1 = earlier
|
public
Zend_Date
|
#
setLocale( string|Zend_Locale $locale = null )
Sets a new standard locale for the date object. This locale will be used for
all functions Returned is the really set locale. Example: 'de_XX' will be set to
'de' because 'de_XX' does not exist 'xx_YY' will be set to 'root' because 'xx'
does not exist
Sets a new standard locale for the date object. This locale will be used for
all functions Returned is the really set locale. Example: 'de_XX' will be set to
'de' because 'de_XX' does not exist 'xx_YY' will be set to 'root' because 'xx'
does not exist
Parameters
- $locale
string|Zend_Locale $locale (Optional) Locale for parsing input
Returns
Throws
Zend_Date_Exception When the given locale does not exist
|
public
string
|
#
getLocale( )
Returns the actual set locale
Returns the actual set locale
Returns
string
|
public static
boolean
|
#
isDate( string|array|Zend_Date $date, string $format = null, string|Zend_Locale $locale = null )
Checks if the given date is a real date or datepart. Returns false if a
expected datepart is missing or a datepart exceeds its possible border. But the
check will only be done for the expected dateparts which are given by format. If
no format is given the standard dateformat for the actual locale is used. f.e.
30.February.2007 will return false if format is 'dd.MMMM.YYYY'
Checks if the given date is a real date or datepart. Returns false if a
expected datepart is missing or a datepart exceeds its possible border. But the
check will only be done for the expected dateparts which are given by format. If
no format is given the standard dateformat for the actual locale is used. f.e.
30.February.2007 will return false if format is 'dd.MMMM.YYYY'
Parameters
- $date
string|array|Zend_Date $date Date to parse for correctness
- $format
string $format (Optional) Format for parsing the date string
- $locale
string|Zend_Locale $locale (Optional) Locale for parsing date parts
Returns
boolean True when all date parts are correct
|
protected static
string
|
#
_getLocalizedToken( string $token, string $locale )
Returns the ISO Token for all localized constants
Returns the ISO Token for all localized constants
Parameters
- $token
string $token Token to normalize
- $locale
string $locale Locale to search
Returns
string
|
protected
float|integer
|
#
mktime( mixed $hour, mixed $minute, mixed $second, mixed $month, mixed $day, mixed $year, boolean $gmt = false )
Get unix timestamp. Added limitation: $year value must be between -10 000 and
10 000 Parent method implementation causes 504 error if it gets too big(small)
year value
Get unix timestamp. Added limitation: $year value must be between -10 000 and
10 000 Parent method implementation causes 504 error if it gets too big(small)
year value
Parameters
- $hour
mixed $hour
- $minute
mixed $minute
- $second
mixed $second
- $month
mixed $month
- $day
mixed $day
- $year
mixed $year
- $gmt
boolean $gmt
Returns
float|integer
Throws
Zend_Date_Exception
See
Zend_Date_DateObject::mktime
|