category | Zend |
---|---|
package | Zend_Date |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Date_DateObject |
__construct(string|integer|\Zend_Date|array $date= null
, string $part= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
string
integer
\Zend_Date
array
OPTIONAL Date value or value of date part to set ,depending on $part. If null the actual time is set
string
OPTIONAL Defines the input format of $date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
__toString() : string
string
add(string|integer|array|\Zend_Date $date, string $part= self::TIMESTAMP
, string|\Zend_Locale $locale= null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Date or datepart to add
string
OPTIONAL Part of the date to add, if null the timestamp is added
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddArpa(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
\Zend_Date
RFC 822 Date to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddDate(string|integer|array|\Zend_Date $date, string $format= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Date to add
string
OPTIONAL Date format for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddDay(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Day to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddDayOfYear(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Day of Year to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddHour(string|integer|array|\Zend_Date $hour, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Hour to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddIso(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
\Zend_Date
ISO Date to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddMilliSecond(integer|\Zend_Date $milli= null
, integer $precision= null
) : \Zend_Date
integer
\Zend_Date
(Optional) Millisecond to add, when null the actual millisecond is added
integer
(Optional) Fractional precision for the given milliseconds
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddMinute(string|integer|array|\Zend_Date $minute, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Minute to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddMonth(string|integer|array|\Zend_Date $month, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Month to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddSecond(string|integer|array|\Zend_Date $second, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Second to add
string
\Zend_Locale
(Optional) Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddTime(string|integer|array|\Zend_Date $time, string $format= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Time to add
string
OPTIONAL Timeformat for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddTimestamp(integer|string|array|\Zend_Date $timestamp) : \Zend_Date
integer
string
array
\Zend_Date
Timestamp to add
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddWeek(string|integer|array|\Zend_Date $week, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25
string
integer
array
\Zend_Date
Week to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddWeekday(string|integer|array|\Zend_Date $weekday, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Weekday to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfaceaddYear(string|integer|array|\Zend_Date $year, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object
string
integer
array
\Zend_Date
Year to add
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacecheckLeapYear(integer|array|\Zend_Date $year) : boolean
integer
array
\Zend_Date
Year to check
\Zend_Date_Exception |
---|
boolean
compare(string|integer|array|\Zend_Date $date, string $part= self::TIMESTAMP
, string|\Zend_Locale $locale= null
) : integer
Returns -1 if earlier, 0 if equal and 1 if later.
string
integer
array
\Zend_Date
Date or datepart to compare with the date object
string
OPTIONAL Part of the date to compare, if null the timestamp is subtracted
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareArpa(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : integer
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
string
integer
\Zend_Date
RFC 822 Date to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareDate(string|integer|array|\Zend_Date $date, string $format= null
, string|\Zend_Locale $locale= null
) : integer
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
string
integer
array
\Zend_Date
Date to compare
string
OPTIONAL Date format for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareDay(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : integer
For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier or later
string
integer
array
\Zend_Date
Day to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareDayOfYear(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : integer
For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0 Returns if equal, earlier or later
string
integer
array
\Zend_Date
Day of Year to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareHour(string|integer|array|\Zend_Date $hour, string|\Zend_Locale $locale = null
) : integer
For example: 10:30:25 -> compareHour(10) -> 0 Returns if equal, earlier or later
string
integer
array
\Zend_Date
Hour to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareIso(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : integer
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
string
integer
\Zend_Date
ISO Date to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareMilliSecond(integer|\Zend_Date $milli= null
, integer $precision= null
) : integer
integer
\Zend_Date
OPTIONAL Millisecond to compare, when null the actual millisecond is compared
integer
OPTIONAL Fractional precision for the given milliseconds
\Zend_Date_Exception |
On invalid input |
---|
integer
0 = equal, 1 = later, -1 = earliercompareMinute(string|integer|array|\Zend_Date $minute, string|\Zend_Locale $locale = null
) : integer
For example: 10:30:25 -> compareMinute(30) -> 0 Returns if equal, earlier or later
string
integer
array
\Zend_Date
Hour to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareMonth(string|integer|array|\Zend_Date $month, string|\Zend_Locale $locale = null
) : integer
For example: 10.03.2000 -> 15.03.1950 -> true Returns if equal, earlier or later
string
integer
array
\Zend_Date
Month to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareSecond(string|integer|array|\Zend_Date $second, string|\Zend_Locale $locale = null
) : integer
For example: 10:30:25 -> compareSecond(25) -> 0 Returns if equal, earlier or later
string
integer
array
\Zend_Date
Second to compare
string
\Zend_Locale
(Optional) Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareTime(string|integer|array|\Zend_Date $time, string $format= null
, string|\Zend_Locale $locale= null
) : integer
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
string
integer
array
\Zend_Date
Time to compare
string
OPTIONAL Timeformat for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareTimestamp(integer|string|array|\Zend_Date $timestamp) : integer
integer
string
array
\Zend_Date
Timestamp to compare
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareWeek(string|integer|array|\Zend_Date $week, string|\Zend_Locale $locale = null
) : integer
string
integer
array
\Zend_Date
Week to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
integer
0 = equal, 1 = later, -1 = earliercompareWeekday(string|integer|array|\Zend_Date $weekday, string|\Zend_Locale $locale = null
) : integer
For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier or later
string
integer
array
\Zend_Date
Weekday to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercompareYear(string|integer|array|\Zend_Date $year, string|\Zend_Locale $locale = null
) : integer
For example: 10.03.2000 -> 15.02.2000 -> true Returns if equal, earlier or later
string
integer
array
\Zend_Date
Year to compare
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
integer
0 = equal, 1 = later, -1 = earliercopyPart(string $part, string|\Zend_Locale $locale = null
) : \Zend_Date
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).
string
Part of the date to compare, if null the timestamp is subtracted
string
\Zend_Locale
OPTIONAL New object's locale. No adjustments to timezone are made.
\Zend_Date
New clone with requested partequals(string|integer|array|\Zend_Date $date, string $part= self::TIMESTAMP
, string|\Zend_Locale $locale= null
) : boolean
For example: 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false
string
integer
array
\Zend_Date
Date or datepart to equal with
string
OPTIONAL Part of the date to compare, if null the timestamp is used
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
boolean
get(string $part= null
, string|\Zend_Locale $locale= null
) : string
For a complete list of supported datepart values look into the docu
string
OPTIONAL Part of the date to return, if null the timestamp is returned
string
\Zend_Locale
OPTIONAL Locale for parsing input
string
date or datepartgetArpa(string|\Zend_Locale $locale = null
) : string
This function does not return the RFC date as object. Use copy() instead.
string
\Zend_Locale
OPTIONAL Locale for parsing input
string
getDate(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getDay(\Zend_Locale $locale = null
) : \Zend_Date
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getDayOfYear(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getFractionalPrecision() : integer
integer
getFullYear(integer $value) : integer
integer
year number
integer
Number of yeargetGmtOffset() : integer
The offset to GMT is initially set when the object is instantiated using the currently, in effect, default timezone for PHP functions.
integer
seconds difference between GMT timezone and timezone when object was instantiatedgetHour(\Zend_Locale $locale = null
) : \Zend_Date
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getIso(string|\Zend_Locale $locale = null
) : string
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.
string
\Zend_Locale
OPTIONAL Locale for parsing input
string
getLocale() : string
string
getMilliSecond() : string
string
getMinute(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getMonth(string|\Zend_Locale $locale = null
) : \Zend_Date
For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getSecond(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getSunInfo(array $location) : array
array
location of suninfo ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
\Zend_Date_Exception |
---|
array
- [sunset|sunrise][effective|civil|nautic|astronomic]getSunrise(array $location) : \Zend_Date
array
location of sunrise ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
\Zend_Date_Exception |
---|
\Zend_Date
getSunset(array $location) : \Zend_Date
array
location of sunset ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
\Zend_Date_Exception |
---|
\Zend_Date
getTime(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getTimestamp() : integer | string
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.
integer
string
UNIX timestampgetTimezone() : string
The timezone is initially set when the object is instantiated.
string
actual set timezone stringgetTimezoneFromString(string $zone) : integer
string
integer
getWeek(\Zend_Locale $locale = null
) : \Zend_Date
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getWeekday(\Zend_Locale $locale = null
) : \Zend_Date
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
getYear(string|\Zend_Locale $locale = null
) : \Zend_Date
For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
isDate(string|array|\Zend_Date $date, string $format= null
, string|\Zend_Locale $locale= null
) : boolean
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'
string
array
\Zend_Date
Date to parse for correctness
string
(Optional) Format for parsing the date string
string
\Zend_Locale
(Optional) Locale for parsing date parts
boolean
True when all date parts are correctisEarlier(string|integer|array|\Zend_Date $date, string $part= null
, string|\Zend_Locale $locale= null
) : boolean
string
integer
array
\Zend_Date
Date or datepart to compare with
string
OPTIONAL Part of the date to compare, if null the timestamp is used
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
boolean
isLater(string|integer|array|\Zend_Date $date, string $part= null
, string|\Zend_Locale $locale= null
) : boolean
string
integer
array
\Zend_Date
Date or datepart to compare with
string
OPTIONAL Part of the date to compare, if null the timestamp is used
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
boolean
isLeapYear() : boolean
boolean
isToday() : boolean
boolean
isTomorrow() : boolean
boolean
isYesterday() : boolean
boolean
now(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date
set(string|integer|array|\Zend_Date $date, string $part= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
For a complete list of supported datepart values look into the docu
string
integer
array
\Zend_Date
Date or datepart to set
string
OPTIONAL Part of the date to set, if null the timestamp is set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetArpa(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : \Zend_Date
Only RFC 822 compilant date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object
string
integer
\Zend_Date
RFC 822 to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetDate(string|integer|array|\Zend_Date $date, string $format= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Date to set
string
OPTIONAL Date format for parsing
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetDay(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Day to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetDayOfYear(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004
string
integer
array
\Zend_Date
Day of Year to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetFractionalPrecision(integer $precision) : \Zend_Date
integer
Precision for the fractional datepart 3 = milliseconds
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetHour(string|integer|array|\Zend_Date $hour, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25
string
integer
array
\Zend_Date
Hour to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetIso(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
\Zend_Date
ISO Date to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetLocale(string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
\Zend_Locale
(Optional) Locale for parsing input
\Zend_Date_Exception |
When the given locale does not exist |
---|
\Zend_Date
Provides fluent interfacesetMilliSecond(integer|\Zend_Date $milli= null
, integer $precision= null
) : \Zend_Date
integer
\Zend_Date
(Optional) Millisecond to set, when null the actual millisecond is set
integer
(Optional) Fraction precision of the given milliseconds
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetMinute(string|integer|array|\Zend_Date $minute, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993 13:29:25
string
integer
array
\Zend_Date
Minute to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetMonth(string|integer|array|\Zend_Date $month, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object
string
integer
array
\Zend_Date
Month to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetOptions(array $options = array()
) : \Options
array
Options to set
\Zend_Date_Exception |
---|
\Options
array if no option was givensetSecond(string|integer|array|\Zend_Date $second, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Second to set
string
\Zend_Locale
(Optional) Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetTime(string|integer|array|\Zend_Date $time, string $format= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Time to set
string
OPTIONAL Timeformat for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetTimestamp(integer|string|array|\Zend_Date $timestamp) : \Zend_Date
integer
string
array
\Zend_Date
Timestamp to set
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetTimezone(string $zone = null
) : \Zend_Date_DateObject
For a list of supported timezones look here: http://php.net/timezones If no timezone can be detected or the given timezone is wrong UTC will be set.
string
OPTIONAL timezone for date calculation; defaults to date_default_timezone_get()
\Zend_Date_Exception |
---|
\Zend_Date_DateObject
Provides fluent interfacesetWeek(string|integer|array|\Zend_Date $week, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25
string
integer
array
\Zend_Date
Week to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetWeekday(string|integer|array|\Zend_Date $weekday, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object. Example: setWeekday(3); will set the wednesday of this week as day.
string
integer
array
\Zend_Date
Weekday to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesetYear(string|integer|array|\Zend_Date $year, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object
string
integer
array
\Zend_Date
Year to set
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesub(string|integer|array|\Zend_Date $date, string $part= self::TIMESTAMP
, string|\Zend_Locale $locale= null
) : \Zend_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 !!!
string
integer
array
\Zend_Date
Date or datepart to subtract
string
OPTIONAL Part of the date to sub, if null the timestamp is subtracted
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubArpa(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
\Zend_Date
RFC 822 Date to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubDate(string|integer|array|\Zend_Date $date, string $format= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
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 !!!
string
integer
array
\Zend_Date
Date to sub
string
OPTIONAL Date format for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubDay(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Day to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubDayOfYear(string|integer|array|\Zend_Date $day, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Day of Year to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubHour(string|integer|array|\Zend_Date $hour, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Hour to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubIso(string|integer|\Zend_Date $date, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
\Zend_Date
ISO Date to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubMilliSecond(integer|\Zend_Date $milli= null
, integer $precision= null
) : \Zend_Date
integer
\Zend_Date
(Optional) Millisecond to sub, when null the actual millisecond is subtracted
integer
(Optional) Fractional precision for the given milliseconds
\Zend_Date
Provides a fluent interfacesubMinute(string|integer|array|\Zend_Date $minute, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Minute to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubMonth(string|integer|array|\Zend_Date $month, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Month to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubSecond(string|integer|array|\Zend_Date $second, string|\Zend_Locale $locale = null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Second to sub
string
\Zend_Locale
(Optional) Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubTime(string|integer|array|\Zend_Date $time, string $format= null
, string|\Zend_Locale $locale= null
) : \Zend_Date
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
string
integer
array
\Zend_Date
Time to sub
string
OPTIONAL Timeformat for parsing input
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent intefacesubTimestamp(integer|string|array|\Zend_Date $timestamp) : \Zend_Date
integer
string
array
\Zend_Date
Timestamp to sub
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubWeek(string|integer|array|\Zend_Date $week, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25
string
integer
array
\Zend_Date
Week to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubWeekday(string|integer|array|\Zend_Date $weekday, string|\Zend_Locale $locale = null
) : \Zend_Date
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.
string
integer
array
\Zend_Date
Weekday to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacesubYear(string|integer|array|\Zend_Date $year, string|\Zend_Locale $locale = null
) : \Zend_Date
Returned is the new date object
string
integer
array
\Zend_Date
Year to sub
string
\Zend_Locale
OPTIONAL Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
Provides a fluent interfacetoArray() : array
array
toString(string $format= null
, string $type= null
, string|\Zend_Locale $locale= null
) : string
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
string
OPTIONAL Rule for formatting output. If null the default date format is used
string
OPTIONAL Type for the format string which overrides the standard setting
string
\Zend_Locale
OPTIONAL Locale for parsing input
string
toValue(string|integer|\Zend_Date $part = null
) : integer | false
string
integer
\Zend_Date
OPTIONAL Defines the date or datepart to return as integer
integer
false
_getLocalizedToken(string $token, string $locale) : string
string
Token to normalize
string
Locale to search
string
_getTagSupportForCache()
_getTime(integer $sync = null
) : integer
Returns time(). This method exists to allow unit tests to work-around methods that might otherwise be hard-coded to use time(). For example, this makes it possible to test isYesterday() in Date.php.
integer
OPTIONAL time syncronisation value
integer
timestampcalcSun(array $location, boolean $horizon, $rise = false
) : mixed
array
Location for calculation MUST include 'latitude', 'longitude', 'horizon'
boolean
true: sunrise; false: sunset
mixed
- false: midnight sun, integer:date(string $format, mixed $timestamp= null
, boolean $gmt= false
) : string
Returns a formatted date for a given timestamp.
string
format for output
mixed
boolean
OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
string
dayOfWeek(integer $year, integer $month, integer $day) : integer
0 = sunday, 6 = saturday
integer
integer
integer
integer
dayOfWeekgetDateParts(mixed $timestamp= null
, boolean $fast= null
) : array
Returns an array of date parts for $timestamp, relative to 1970/01/01 00:00:00 GMT/UTC.
$fast specifies ALL date parts should be returned (slower) Default is false, and excludes $dayofweek, weekday, month and timestamp from parts returned.
mixed
boolean
OPTIONAL defaults to fast (false), resulting in fewer date parts
array
getUnixTimestamp() : integer | string
integer
string
timestampisYearLeapYear(integer $year) : boolean
integer
boolean
true, if year is leap yearmktime(integer $hour, integer $minute, integer $second, integer $month, integer $day, integer $year, boolean $gmt = false
) : integer | float
The timestamp returned by mktime() can exceed the precision of traditional UNIX timestamps, by allowing PHP to auto-convert to using a float value.
Returns a timestamp relative to 1970/01/01 00:00:00 GMT/UTC. DST (Summer/Winter) is depriciated since php 5.1.0. Year has to be 4 digits otherwise it would be recognised as year 70 AD instead of 1970 AD as expected !!
integer
integer
integer
integer
integer
integer
boolean
OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
integer
float
timestamp (number of seconds elapsed relative to 1970/01/01 00:00:00 GMT/UTC)setUnixTimestamp(string|integer $timestamp = null
) : string | integer
string
integer
OPTIONAL timestamp; defaults to local time using time()
\Zend_Date_Exception |
---|
string
integer
old timestampweekNumber(integer $year, integer $month, integer $day) : integer
Returns the ISO 8601 week number of a given date
integer
integer
integer
integer
_assign(string $calc, string|integer $date, string|integer $comp= 0
, boolean|integer $dst= false
) : integer | string | \Zend_Date
string
Calculation to make
string
integer
Date for calculation
string
integer
Second date for calculation
boolean
integer
Use dst correction if option is set
integer
string
\Zend_Date
new timestamp or Zend_Date depending on calculation_calcdetail(string $calc, string|integer|array|\Zend_Date $date, string $type, string|\Zend_Locale $locale) : integer | string
string
Calculation to make
string
integer
array
\Zend_Date
Date or Part to calculate
string
Datepart for Calculation
string
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
integer
string
new date_calculate(string $calc, string|integer|array|\Zend_Date $date, string $part, string|\Zend_Locale $locale) : integer | string | \Zend_Date
string
Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set'
string
integer
array
\Zend_Date
Date or datepart to calculate with
string
Part of the date to calculate, if null the timestamp is used
string
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
integer
string
\Zend_Date
new timestamp_calcvalue(string $calc, string|integer|\Zend_Date $value, string $type, string $parameter, string|\Zend_Locale $locale) : integer | \Zend_Date
string
Calculation to make
string
integer
\Zend_Date
Datevalue to calculate with, if null the actual value is taken
string
string
string
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
integer
\Zend_Date
new date_checkLocation(array $location) : float
array
locations array
\Zend_Date_Exception |
---|
float
$horizon float_date(string $calc, string|integer|array|\Zend_Date $date, string $format, string|\Zend_Locale $locale) : integer | \Zend_Date
string
Calculation to make
string
integer
array
\Zend_Date
Date to calculate with, if null the actual date is taken
string
Date format for parsing
string
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
integer
\Zend_Date
new date_day(string $calc, \Zend_Date $day, \Zend_Locale $locale) : \Zend_Date | integer
string
Type of calculation to make
\Zend_Date
Day to calculate, when null the actual day is calculated
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
integer
_getDigitFromName(string $name) : integer
string
\Zend_Date_Exception |
---|
integer
Number of this month_month(string $calc, string|integer|array|\Zend_Date $month, string|\Zend_Locale $locale) : integer | \Zend_Date
string
Calculation to make
string
integer
array
\Zend_Date
Month to calculate with, if null the actual month is taken
string
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
integer
\Zend_Date
new time_parseIsoToDate(string $token, string $locale) : string
string
string
string
_range(float $a, float $b)
float
float
_time(string $calc, string|integer|array|\Zend_Date $time, string $format, string|\Zend_Locale $locale) : integer | \Zend_Date
string
Calculation to make
string
integer
array
\Zend_Date
Time to calculate with, if null the actual time is taken
string
Timeformat for parsing input
string
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
integer
\Zend_Date
new time_toComment(string $token) : string
string
string
_toToken(string $part, string $locale) : string
string
string
string
_weekday(string $calc, \Zend_Date $weekday, \Zend_Locale $locale) : \Zend_Date | integer
string
Type of calculation to make
\Zend_Date
Weekday to calculate, when null the actual weekday is calculated
\Zend_Locale
Locale for parsing input
\Zend_Date_Exception |
---|
\Zend_Date
integer
$_cache
null
$_cacheTags
false
$_defaultOffset
0
$_dst
true
$_fractional
0
$_locale
null
$_monthTable
array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
$_offset
0
$_precision
3
$_syncronised
0
$_timezone
'UTC'
$_unixTimestamp
$_yearTable
array(1970 => 0, 1960 => -315619200, 1950 => -631152000, 1940 => -946771200, 1930 => -1262304000, 1920 => -1577923200, 1910 => -1893456000, 1900 => -2208988800, 1890 => -2524521600, 1880 => -2840140800, 1870 => -3155673600, 1860 => -3471292800, 1850 => -3786825600, 1840 => -4102444800, 1830 => -4417977600, 1820 => -4733596800, 1810 => -5049129600, 1800 => -5364662400, 1790 => -5680195200, 1780 => -5995814400, 1770 => -6311347200, 1760 => -6626966400, 1750 => -6942499200, 1740 => -7258118400, 1730 => -7573651200, 1720 => -7889270400, 1710 => -8204803200, 1700 => -8520336000, 1690 => -8835868800, 1680 => -9151488000, 1670 => -9467020800, 1660 => -9782640000, 1650 => -10098172800, 1640 => -10413792000, 1630 => -10729324800, 1620 => -11044944000, 1610 => -11360476800, 1600 => -11676096000)
ATOM = 'OOO'
COOKIE = 'CCC'
DATES = 'F'
DATETIME = 'K'
DATETIME_FULL = 'KKKKK'
DATETIME_LONG = 'KKKK'
DATETIME_MEDIUM = 'KKK'
DATETIME_SHORT = 'KK'
DATE_FULL = 'FFFFF'
DATE_LONG = 'FFFF'
DATE_MEDIUM = 'FFF'
DATE_SHORT = 'FF'
DAY = 'dd'
DAYLIGHT = 'I'
DAY_OF_YEAR = 'D'
DAY_SHORT = 'd'
DAY_SUFFIX = 'SS'
ERA = 'G'
ERA_NAME = 'GGGG'
ERA_NARROW = 'GGGGG'
GMT_DIFF = 'Z'
GMT_DIFF_SEP = 'ZZZZ'
HOUR = 'HH'
HOUR_AM = 'hh'
HOUR_SHORT = 'H'
HOUR_SHORT_AM = 'h'
ISO_8601 = 'c'
LEAPYEAR = 'l'
MERIDIEM = 'a'
MILLISECOND = 'S'
MINUTE = 'mm'
MINUTE_SHORT = 'm'
MONTH = 'MM'
MONTH_DAYS = 'ddd'
MONTH_NAME = 'MMMM'
MONTH_NAME_NARROW = 'MMMMM'
MONTH_NAME_SHORT = 'MMM'
MONTH_SHORT = 'M'
RFC_1036 = 'RRR'
RFC_1123 = 'RRRR'
RFC_2822 = 'r'
RFC_3339 = 'RRRRR'
RFC_822 = 'R'
RFC_850 = 'RR'
RSS = 'SSS'
SECOND = 'ss'
SECOND_SHORT = 's'
SWATCH = 'B'
TIMES = 'WW'
TIMESTAMP = 'U'
TIMEZONE = 'z'
TIMEZONE_NAME = 'zzzz'
TIMEZONE_SECS = 'X'
TIME_FULL = 'TTTTT'
TIME_LONG = 'TTTT'
TIME_MEDIUM = 'TTT'
TIME_SHORT = 'TT'
W3C = 'WWW'
WEEK = 'ww'
WEEKDAY = 'EEEE'
WEEKDAY_8601 = 'eee'
WEEKDAY_DIGIT = 'e'
WEEKDAY_NAME = 'EE'
WEEKDAY_NARROW = 'E'
WEEKDAY_SHORT = 'EEE'
YEAR = 'y'
YEAR_8601 = 'Y'
YEAR_SHORT = 'yy'
YEAR_SHORT_8601 = 'YY'