Date.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Date
- Version
- $Id$
\Zend_Date
- Parent(s)
- \Zend_Date_DateObject
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

$_options = array('format_type' => 'iso', 'fix_dst' => true, 'extend_month' => false, 'cache' => null, 'timesync' => null)array('format_type' => 'iso', 'fix_dst' => true, 'extend_month' => false, 'cache' => null, 'timesync' => null)Details- Type
- n/a
Methods

__construct(string | integer | \Zend_Date | array $date = null, string $part = null, string | \Zend_Locale $locale = null) : \Zend_DateGenerates 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.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | array | OPTIONAL Date value or value of date part to set |
| $part | string | OPTIONAL Defines the input format of $date |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

__toString() : stringReturns a string representation of the date which is equal with the timestamp
| Type | Description |
|---|---|
| string |

_assign(string $calc, string | integer $date, string | integer $comp = 0, boolean | integer $dst = false) : integer | string | \Zend_DateCalculates the date or object
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make |
| $date | string | integer | Date for calculation |
| $comp | string | integer | Second date for calculation |
| $dst | boolean | integer | Use dst correction if option is set |
| Type | Description |
|---|---|
| integer | string | \Zend_Date | new timestamp or Zend_Date depending on calculation |

_calcdetail(string $calc, string | integer | array | \Zend_Date $date, $type, string | \Zend_Locale $locale) : integer | stringCalculate date details
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make |
| $date | string | integer | array | \Zend_Date | Date or Part to calculate |
| $type | ||
| $locale | string | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| integer | string | new date |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_calculate(string $calc, string | integer | array | \Zend_Date $date, string $part, string | \Zend_Locale $locale) : integer | string | \Zend_DateCalculates the date or object
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set' |
| $date | string | integer | array | \Zend_Date | Date or datepart to calculate with |
| $part | string | Part of the date to calculate, if null the timestamp is used |
| $locale | string | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| integer | string | \Zend_Date | new timestamp |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_calcvalue(string $calc, string | integer | \Zend_Date $value, $type, $parameter, string | \Zend_Locale $locale) : integer | \Zend_DateInternal calculation, returns the requested date type
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make |
| $value | string | integer | \Zend_Date | Datevalue to calculate with, if null the actual value is taken |
| $type | ||
| $parameter | ||
| $locale | string | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| integer | \Zend_Date | new date |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_checkLocation(array $location) : \$horizonCheck if location is supported
| Name | Type | Description |
|---|---|---|
| $location | array | locations array |
| Type | Description |
|---|---|
| \$horizon | float |

_date(string $calc, string | integer | array | \Zend_Date $date, string $format, string | \Zend_Locale $locale) : integer | \Zend_DateReturns the calculated date
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make |
| $date | string | integer | array | \Zend_Date | Date to calculate with, if null the actual date is taken |
| $format | string | Date format for parsing |
| $locale | string | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| integer | \Zend_Date | new date |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_day(string $calc, \Zend_Date $day, \Zend_Locale $locale) : \Zend_Date | integerReturns the calculated day
| Name | Type | Description |
|---|---|---|
| $calc | string | Type of calculation to make |
| $day | \Zend_Date | Day to calculate, when null the actual day is calculated |
| $locale | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | integer |

_getDigitFromName(string $name) : integerReturn digit from standard names (english) Faster implementation than locale aware searching
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| integer | Number of this month |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_getLocalizedToken(string $token, string $locale) : stringReturns the ISO Token for all localized constants
| Name | Type | Description |
|---|---|---|
| $token | string | Token to normalize |
| $locale | string | Locale to search |
| Type | Description |
|---|---|
| string |

_month(string $calc, string | integer | array | \Zend_Date $month, string | \Zend_Locale $locale) : integer | \Zend_DateReturns the calculated month
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make |
| $month | string | integer | array | \Zend_Date | Month to calculate with, if null the actual month is taken |
| $locale | string | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| integer | \Zend_Date | new time |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_parseIsoToDate(string $token, string $locale) : stringInternal parsing method
| Name | Type | Description |
|---|---|---|
| $token | string | |
| $locale | string |
| Type | Description |
|---|---|
| string |

_time(string $calc, string | integer | array | \Zend_Date $time, string $format, string | \Zend_Locale $locale) : integer | \Zend_DateReturns the calculated time
| Name | Type | Description |
|---|---|---|
| $calc | string | Calculation to make |
| $time | string | integer | array | \Zend_Date | Time to calculate with, if null the actual time is taken |
| $format | string | Timeformat for parsing input |
| $locale | string | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| integer | \Zend_Date | new time |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_timestamp(string $calc, string | integer | array | \Zend_Date $stamp) : \Zend_Date | integerReturns the calculated timestamp HINT: timestamps are always GMT
| Name | Type | Description |
|---|---|---|
| $calc | string | Type of calculation to make |
| $stamp | string | integer | array | \Zend_Date | Timestamp to calculate, when null the actual timestamp is calculated |
| Type | Description |
|---|---|
| \Zend_Date | integer |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

_toComment(string $token) : stringPrivate function to make a comment of a token
| Name | Type | Description |
|---|---|---|
| $token | string |
| Type | Description |
|---|---|
| string |

_toToken(string $part, string $locale) : stringInternal method to apply tokens
| Name | Type | Description |
|---|---|---|
| $part | string | |
| $locale | string |
| Type | Description |
|---|---|
| string |

_weekday(string $calc, \Zend_Date $weekday, \Zend_Locale $locale) : \Zend_Date | integerReturns the calculated weekday
| Name | Type | Description |
|---|---|---|
| $calc | string | Type of calculation to make |
| $weekday | \Zend_Date | Weekday to calculate, when null the actual weekday is calculated |
| $locale | \Zend_Locale | Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | integer |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

add(string | integer | array | \Zend_Date $date, string $part = self::TIMESTAMP, string | \Zend_Locale $locale = null) : \Zend_DateAdds 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).
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to add |
| $part | string | OPTIONAL Part of the date to add, if null the timestamp is added |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addArpa(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : \Zend_DateAdds a RFC 822 date to the date object.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | RFC 822 Date to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addDate(string | integer | array | \Zend_Date $date, string $format = null, string | \Zend_Locale $locale = null) : \Zend_DateAdds a date to the existing date object. Format defines how to parse the date string.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date to add |
| $format | string | OPTIONAL Date format for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addDay( $day, string | \Zend_Locale $locale = null) : \Zend_DateAdds days to the existing date object.
| Name | Type | Description |
|---|---|---|
| $day | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addDayOfYear(string | integer | array | \Zend_Date $day, string | \Zend_Locale $locale = null) : \Zend_DateAdds a day of year to the existing date object.
| Name | Type | Description |
|---|---|---|
| $day | string | integer | array | \Zend_Date | Day of Year to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addHour(string | integer | array | \Zend_Date $hour, string | \Zend_Locale $locale = null) : \Zend_DateAdds hours to the existing date object.
| Name | Type | Description |
|---|---|---|
| $hour | string | integer | array | \Zend_Date | Hour to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addIso(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : \Zend_DateAdds a ISO date to the date object. Not given parts are set to default.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | ISO Date to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addMilliSecond(integer | \Zend_Date $milli = null, integer $precision = null) : \Zend_DateAdds milliseconds to the date object
| Name | Type | Description |
|---|---|---|
| $milli | integer | \Zend_Date | (Optional) Millisecond to add, when null the actual millisecond is added |
| $precision | integer | (Optional) Fractional precision for the given milliseconds |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |

addMinute(string | integer | array | \Zend_Date $minute, string | \Zend_Locale $locale = null) : \Zend_DateAdds minutes to the existing date object.
| Name | Type | Description |
|---|---|---|
| $minute | string | integer | array | \Zend_Date | Minute to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addMonth(string | integer | array | \Zend_Date $month, string | \Zend_Locale $locale = null) : \Zend_DateAdds months to the existing date object.
| Name | Type | Description |
|---|---|---|
| $month | string | integer | array | \Zend_Date | Month to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addSecond(string | integer | array | \Zend_Date $second, string | \Zend_Locale $locale = null) : \Zend_DateAdds seconds to the existing date object.
| Name | Type | Description |
|---|---|---|
| $second | string | integer | array | \Zend_Date | Second to add |
| $locale | string | \Zend_Locale | (Optional) Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addTime(string | integer | array | \Zend_Date $time, string $format = null, string | \Zend_Locale $locale = null) : \Zend_DateAdds a time to the existing date. Format defines how to parse the time string.
| Name | Type | Description |
|---|---|---|
| $time | string | integer | array | \Zend_Date | Time to add |
| $format | string | OPTIONAL Timeformat for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addTimestamp(integer | string | array | \Zend_Date $timestamp) : \Zend_DateAdds a timestamp
| Name | Type | Description |
|---|---|---|
| $timestamp | integer | string | array | \Zend_Date | Timestamp to add |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addWeek(string | integer | array | \Zend_Date $week, string | \Zend_Locale $locale = null) : \Zend_DateAdds a week. The week is always a number. The day of week is not changed.
| Name | Type | Description |
|---|---|---|
| $week | string | integer | array | \Zend_Date | Week to add |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addWeekday( $weekday, string | \Zend_Locale $locale = null) : \Zend_DateAdds weekdays to the existing date object.
| Name | Type | Description |
|---|---|---|
| $weekday | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

addYear( $year, string | \Zend_Locale $locale = null) : \Zend_DateAdds 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.
| Name | Type | Description |
|---|---|---|
| $year | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

checkLeapYear(integer | array | \Zend_Date $year) : booleanCheck a given year for leap year.
| Name | Type | Description |
|---|---|---|
| $year | integer | array | \Zend_Date | Year to check |
| Type | Description |
|---|---|
| boolean |

compare(string | integer | array | \Zend_Date $date, string $part = self::TIMESTAMP, string | \Zend_Locale $locale = null) : integerCompares a date or datepart with the existing one.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to compare with the date object |
| $part | string | OPTIONAL Part of the date to compare, if null the timestamp is subtracted |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareArpa(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : integerCompares a RFC 822 compilant date with the date object.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | RFC 822 Date to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareDate(string | integer | array | \Zend_Date $date, string $format = null, string | \Zend_Locale $locale = null) : integerCompares the date from the existing date object, ignoring the time.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date to compare |
| $format | string | OPTIONAL Date format for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareDay(string | integer | array | \Zend_Date $day, string | \Zend_Locale $locale = null) : integerCompares the day with the existing date object, ignoring other date parts.
| Name | Type | Description |
|---|---|---|
| $day | string | integer | array | \Zend_Date | Day to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareDayOfYear(string | integer | array | \Zend_Date $day, string | \Zend_Locale $locale = null) : integerCompares the day of year with the existing date object.
| Name | Type | Description |
|---|---|---|
| $day | string | integer | array | \Zend_Date | Day of Year to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareHour(string | integer | array | \Zend_Date $hour, string | \Zend_Locale $locale = null) : integerCompares the hour with the existing date object.
| Name | Type | Description |
|---|---|---|
| $hour | string | integer | array | \Zend_Date | Hour to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareIso(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : integerCompares a ISO date with the date object. Not given parts are set to default.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | ISO Date to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareMilliSecond(integer | \Zend_Date $milli = null, integer $precision = null) : integerCompares only the millisecond part, returning the difference
| Name | Type | Description |
|---|---|---|
| $milli | integer | \Zend_Date | OPTIONAL Millisecond to compare, when null the actual millisecond is compared |
| $precision | integer | OPTIONAL Fractional precision for the given milliseconds |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception | On invalid input |

compareMinute(string | integer | array | \Zend_Date $minute, string | \Zend_Locale $locale = null) : integerCompares the minute with the existing date object.
| Name | Type | Description |
|---|---|---|
| $minute | string | integer | array | \Zend_Date | Hour to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareMonth(string | integer | array | \Zend_Date $month, string | \Zend_Locale $locale = null) : integerCompares the month with the existing date object, ignoring other date parts.
| Name | Type | Description |
|---|---|---|
| $month | string | integer | array | \Zend_Date | Month to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareSecond(string | integer | array | \Zend_Date $second, string | \Zend_Locale $locale = null) : integerCompares the second with the existing date object.
| Name | Type | Description |
|---|---|---|
| $second | string | integer | array | \Zend_Date | Second to compare |
| $locale | string | \Zend_Locale | (Optional) Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareTime(string | integer | array | \Zend_Date $time, string $format = null, string | \Zend_Locale $locale = null) : integerCompares the time from the existing date. Format defines how to parse the time string.
| Name | Type | Description |
|---|---|---|
| $time | string | integer | array | \Zend_Date | Time to compare |
| $format | string | OPTIONAL Timeformat for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareTimestamp(integer | string | array | \Zend_Date $timestamp) : integerCompares two timestamps, returning the difference as integer
| Name | Type | Description |
|---|---|---|
| $timestamp | integer | string | array | \Zend_Date | Timestamp to compare |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareWeek(string | integer | array | \Zend_Date $week, string | \Zend_Locale $locale = null) : integerCompares 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
| Name | Type | Description |
|---|---|---|
| $week | string | integer | array | \Zend_Date | Week to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |

compareWeekday(string | integer | array | \Zend_Date $weekday, string | \Zend_Locale $locale = null) : integerCompares the weekday with the existing date object, ignoring other date parts.
| Name | Type | Description |
|---|---|---|
| $weekday | string | integer | array | \Zend_Date | Weekday to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

compareYear(string | integer | array | \Zend_Date $year, string | \Zend_Locale $locale = null) : integerCompares the year with the existing date object, ignoring other date parts.
| Name | Type | Description |
|---|---|---|
| $year | string | integer | array | \Zend_Date | Year to compare |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| integer | 0 = equal, 1 = later, -1 = earlier |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

copyPart(string $part, string | \Zend_Locale $locale = null) : \Zend_DateReturns a new instance of Zend_Date with the selected part copied.
| Name | Type | Description |
|---|---|---|
| $part | string | Part of the date to compare, if null the timestamp is subtracted |
| $locale | string | \Zend_Locale | OPTIONAL New object's locale. No adjustments to timezone are made. |
| Type | Description |
|---|---|
| \Zend_Date | New clone with requested part |

equals(string | integer | array | \Zend_Date $date, string $part = self::TIMESTAMP, string | \Zend_Locale $locale = null) : booleanReturns true when both date objects or date parts are equal.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to equal with |
| $part | string | OPTIONAL Part of the date to compare, if null the timestamp is used |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

get(string $part = null, string | \Zend_Locale $locale = null) : stringReturns 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.
| Name | Type | Description |
|---|---|---|
| $part | string | OPTIONAL Part of the date to return, if null the timestamp is returned |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| string | date or datepart |

getArpa(string | \Zend_Locale $locale = null) : stringReturns a RFC 822 compilant datestring from the date object.
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| string |

getDate(string | \Zend_Locale $locale = null) : \Zend_DateReturns a clone of $this, with the time part set to 00:00:00.
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getDay(\Zend_Locale $locale = null) : \Zend_DateReturns the day as new date object Example: 20.May.1986 -> 20.Jan.1970 00:00:00
| Name | Type | Description |
|---|---|---|
| $locale | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getDayOfYear(string | \Zend_Locale $locale = null) : \Zend_DateReturns the day of year as new date object Example: 02.Feb.1986 10:00:00 -> 02.Feb.1970 00:00:00
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getFractionalPrecision() : integerReturns the precision for fractional seconds
| Type | Description |
|---|---|
| integer |

getFullYear(integer $value) : integerCounts the exact year number < 70 - 2000 added, >70 < 100 - 1900, others just returned
| Name | Type | Description |
|---|---|---|
| $value | integer | year number |
| Type | Description |
|---|---|
| integer | Number of year |

getHour(\Zend_Locale $locale = null) : \Zend_DateReturns the hour as new date object Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00
| Name | Type | Description |
|---|---|---|
| $locale | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getIso(string | \Zend_Locale $locale = null) : stringReturns the full ISO 8601 date from the date object.
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| string |

getMinute(string | \Zend_Locale $locale = null) : \Zend_DateReturns the minute as new date object Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:30:00
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getMonth(string | \Zend_Locale $locale = null) : \Zend_DateReturns only the month from the date object as new object.
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getSecond(string | \Zend_Locale $locale = null) : \Zend_DateReturns the second as new date object Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:00:25
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getSunInfo(array $location) : arrayReturns 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
| Name | Type | Description |
|---|---|---|
| $location | array | location of suninfo |
| Type | Description |
|---|---|
| array | - [sunset|sunrise][effective|civil|nautic|astronomic] |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

getSunrise(array $location) : \Zend_DateReturns 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
| Name | Type | Description |
|---|---|---|
| $location | array | location of sunrise |
| Type | Description |
|---|---|
| \Zend_Date |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

getSunset(array $location) : \Zend_DateReturns 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
| Name | Type | Description |
|---|---|---|
| $location | array | location of sunset |
| Type | Description |
|---|---|
| \Zend_Date |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

getTime(string | \Zend_Locale $locale = null) : \Zend_DateReturns 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
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getTimestamp() : integer | stringReturns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP).
| Type | Description |
|---|---|
| integer | string | UNIX timestamp |

getTimezoneFromString(string $zone) : integerInternal function, returns the offset of a given timezone
| Name | Type | Description |
|---|---|---|
| $zone | string |
| Type | Description |
|---|---|
| integer |

getWeek(\Zend_Locale $locale = null) : \Zend_DateReturns the week as new date object using monday as begining of the week Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00
| Name | Type | Description |
|---|---|---|
| $locale | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getWeekday(\Zend_Locale $locale = null) : \Zend_DateReturns 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)
| Name | Type | Description |
|---|---|---|
| $locale | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

getYear(string | \Zend_Locale $locale = null) : \Zend_DateReturns only the year from the date object as new object.
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

isDate(string | array | \Zend_Date $date, string $format = null, string | \Zend_Locale $locale = null) : booleanChecks if the given date is a real date or datepart.
| Name | Type | Description |
|---|---|---|
| $date | string | array | \Zend_Date | Date to parse for correctness |
| $format | string | (Optional) Format for parsing the date string |
| $locale | string | \Zend_Locale | (Optional) Locale for parsing date parts |
| Type | Description |
|---|---|
| boolean | True when all date parts are correct |

isEarlier(string | integer | array | \Zend_Date $date, string $part = null, string | \Zend_Locale $locale = null) : booleanReturns 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
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to compare with |
| $part | string | OPTIONAL Part of the date to compare, if null the timestamp is used |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

isLater(string | integer | array | \Zend_Date $date, string $part = null, string | \Zend_Locale $locale = null) : booleanReturns 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
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to compare with |
| $part | string | OPTIONAL Part of the date to compare, if null the timestamp is used |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

now(string | \Zend_Locale $locale = null) : \Zend_DateReturns the actual date as new date object
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date |

set(string | integer | array | \Zend_Date $date, string $part = null, string | \Zend_Locale $locale = null) : \Zend_DateSets 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.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to set |
| $part | string | OPTIONAL Part of the date to set, if null the timestamp is set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setArpa(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : \Zend_DateSets a RFC 822 date as new date for the date object.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | RFC 822 to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setDate(string | integer | array | \Zend_Date $date, string $format = null, string | \Zend_Locale $locale = null) : \Zend_DateSets a new date for the date object. Format defines how to parse the date string.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date to set |
| $format | string | OPTIONAL Date format for parsing |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setDay( $day, string | \Zend_Locale $locale = null) : \Zend_DateSets 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.
| Name | Type | Description |
|---|---|---|
| $day | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setDayOfYear(string | integer | array | \Zend_Date $day, string | \Zend_Locale $locale = null) : \Zend_DateSets a new day of year The day of year is always a number.
| Name | Type | Description |
|---|---|---|
| $day | string | integer | array | \Zend_Date | Day of Year to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setFractionalPrecision(integer $precision) : \Zend_DateSets a new precision for fractional seconds
| Name | Type | Description |
|---|---|---|
| $precision | integer | Precision for the fractional datepart 3 = milliseconds |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setHour(string | integer | array | \Zend_Date $hour, string | \Zend_Locale $locale = null) : \Zend_DateSets a new hour The hour is always a number.
| Name | Type | Description |
|---|---|---|
| $hour | string | integer | array | \Zend_Date | Hour to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setIso(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : \Zend_DateSets a new date for the date object. Not given parts are set to default.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | ISO Date to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setLocale(string | \Zend_Locale $locale = null) : \Zend_DateSets a new standard locale for the date object.
| Name | Type | Description |
|---|---|---|
| $locale | string | \Zend_Locale | (Optional) Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluent interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception | When the given locale does not exist |

setMilliSecond(integer | \Zend_Date $milli = null, integer $precision = null) : \Zend_DateSets new milliseconds for the date object Example: setMilliSecond(550, 2) -> equals +5 Sec +50 MilliSec
| Name | Type | Description |
|---|---|---|
| $milli | integer | \Zend_Date | (Optional) Millisecond to set, when null the actual millisecond is set |
| $precision | integer | (Optional) Fraction precision of the given milliseconds |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |

setMinute(string | integer | array | \Zend_Date $minute, string | \Zend_Locale $locale = null) : \Zend_DateSets a new minute The minute is always a number.
| Name | Type | Description |
|---|---|---|
| $minute | string | integer | array | \Zend_Date | Minute to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setMonth(string | integer | array | \Zend_Date $month, string | \Zend_Locale $locale = null) : \Zend_DateSets 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.
| Name | Type | Description |
|---|---|---|
| $month | string | integer | array | \Zend_Date | Month to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setOptions(array $options = array()) : \OptionsSets class wide options, if no option was given, the actual set options will be returned
| Name | Type | Description |
|---|---|---|
| $options | array | Options to set |
| Type | Description |
|---|---|
| \Options | array if no option was given |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setSecond(string | integer | array | \Zend_Date $second, string | \Zend_Locale $locale = null) : \Zend_DateSets new seconds to the existing date object.
| Name | Type | Description |
|---|---|---|
| $second | string | integer | array | \Zend_Date | Second to set |
| $locale | string | \Zend_Locale | (Optional) Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setTime(string | integer | array | \Zend_Date $time, string $format = null, string | \Zend_Locale $locale = null) : \Zend_DateSets a new time for the date object. Format defines how to parse the time string.
| Name | Type | Description |
|---|---|---|
| $time | string | integer | array | \Zend_Date | Time to set |
| $format | string | OPTIONAL Timeformat for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setTimestamp(integer | string | array | \Zend_Date $timestamp) : \Zend_DateSets a new timestamp
| Name | Type | Description |
|---|---|---|
| $timestamp | integer | string | array | \Zend_Date | Timestamp to set |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setWeek(string | integer | array | \Zend_Date $week, string | \Zend_Locale $locale = null) : \Zend_DateSets a new week. The week is always a number. The day of week is not changed.
| Name | Type | Description |
|---|---|---|
| $week | string | integer | array | \Zend_Date | Week to set |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setWeekday( $weekday, string | \Zend_Locale $locale = null) : \Zend_DateSets 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).
| Name | Type | Description |
|---|---|---|
| $weekday | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setYear( $year, string | \Zend_Locale $locale = null) : \Zend_DateSets 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.
| Name | Type | Description |
|---|---|---|
| $year | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

sub(string | integer | array | \Zend_Date $date, string $part = self::TIMESTAMP, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a date from another date.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date or datepart to subtract |
| $part | string | OPTIONAL Part of the date to sub, if null the timestamp is subtracted |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subArpa(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a RFC 822 date from the date object.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | RFC 822 Date to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subDate(string | integer | array | \Zend_Date $date, string $format = null, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a date from the existing date object. Format defines how to parse the date string.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | array | \Zend_Date | Date to sub |
| $format | string | OPTIONAL Date format for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subDay( $day, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts days from the existing date object.
| Name | Type | Description |
|---|---|---|
| $day | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subDayOfYear(string | integer | array | \Zend_Date $day, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a day of year from the existing date object.
| Name | Type | Description |
|---|---|---|
| $day | string | integer | array | \Zend_Date | Day of Year to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subHour(string | integer | array | \Zend_Date $hour, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts hours from the existing date object.
| Name | Type | Description |
|---|---|---|
| $hour | string | integer | array | \Zend_Date | Hour to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subIso(string | integer | \Zend_Date $date, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a ISO date from the date object. Not given parts are set to default.
| Name | Type | Description |
|---|---|---|
| $date | string | integer | \Zend_Date | ISO Date to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subMilliSecond(integer | \Zend_Date $milli = null, integer $precision = null) : \Zend_DateSubtracts a millisecond
| Name | Type | Description |
|---|---|---|
| $milli | integer | \Zend_Date | (Optional) Millisecond to sub, when null the actual millisecond is subtracted |
| $precision | integer | (Optional) Fractional precision for the given milliseconds |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |

subMinute(string | integer | array | \Zend_Date $minute, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts minutes from the existing date object.
| Name | Type | Description |
|---|---|---|
| $minute | string | integer | array | \Zend_Date | Minute to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subMonth(string | integer | array | \Zend_Date $month, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts months from the existing date object.
| Name | Type | Description |
|---|---|---|
| $month | string | integer | array | \Zend_Date | Month to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subSecond(string | integer | array | \Zend_Date $second, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts seconds from the existing date object.
| Name | Type | Description |
|---|---|---|
| $second | string | integer | array | \Zend_Date | Second to sub |
| $locale | string | \Zend_Locale | (Optional) Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subTime(string | integer | array | \Zend_Date $time, string $format = null, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a time from the existing date. Format defines how to parse the time string.
| Name | Type | Description |
|---|---|---|
| $time | string | integer | array | \Zend_Date | Time to sub |
| $format | string | OPTIONAL Timeformat for parsing input |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid inteface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subTimestamp(integer | string | array | \Zend_Date $timestamp) : \Zend_DateSubtracts a timestamp
| Name | Type | Description |
|---|---|---|
| $timestamp | integer | string | array | \Zend_Date | Timestamp to sub |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subWeek(string | integer | array | \Zend_Date $week, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts a week. The week is always a number. The day of week is not changed.
| Name | Type | Description |
|---|---|---|
| $week | string | integer | array | \Zend_Date | Week to sub |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subWeekday( $weekday, string | \Zend_Locale $locale = null) : \Zend_DateSubtracts weekdays from the existing date object.
| Name | Type | Description |
|---|---|---|
| $weekday | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

subYear( $year, string | \Zend_Locale $locale = null) : \Zend_DateSubs 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.
| Name | Type | Description |
|---|---|---|
| $year | ||
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| \Zend_Date | Provides fluid interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

toString(string $format = null, string $type = null, string | \Zend_Locale $locale = null) : stringReturns 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
| Name | Type | Description |
|---|---|---|
| $format | string | OPTIONAL Rule for formatting output. If null the default date format is used |
| $type | string | OPTIONAL Type for the format string which overrides the standard setting |
| $locale | string | \Zend_Locale | OPTIONAL Locale for parsing input |
| Type | Description |
|---|---|
| string |

toValue(string | integer | \Zend_Date $part = null) : integer | falseReturns a integer representation of the object But returns false when the given part is no value f.e. Month-Name
| Name | Type | Description |
|---|---|---|
| $part | string | integer | \Zend_Date | OPTIONAL Defines the date or datepart to return as integer |
| Type | Description |
|---|---|
| integer | false |