Class Zend_Date

Description
  • license: New BSD License
  • copyright: Copyright (c) 2006-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Date.php (line 38)

Zend_Date_DateObject
   |
   --Zend_Date
Class Constant Summary
 ATOM = 'ATOM'
 COOKIE = 'COOKIE'
 DATES = 'DATES'
 DATE_FULL = 'DATE_FULL'
 DATE_LONG = 'DATE_LONG'
 DATE_MEDIUM = 'DATE_MEDIUM'
 DATE_SHORT = 'DATE_SHORT'
 DAY = 'DAY'
 DAYLIGHT = 'DAYLIGHT'
 DAY_OF_YEAR = 'DAY_OF_YEAR'
 DAY_SHORT = 'DAY_SHORT'
 DAY_SUFFIX = 'DAY_SUFFIX'
 ERA = 'ERA'
 ERA_NAME = 'ERA_NAME'
 GMT_DIFF = 'GMT_DIFF'
 GMT_DIFF_SEP = 'GMT_DIFF_SEP'
 HOUR = 'HOUR'
 HOUR_AM = 'HOUR_AM'
 HOUR_SHORT = 'HOUR_SHORT'
 HOUR_SHORT_AM = 'HOUR_SHORT_AM'
 ISO_8601 = 'ISO_8601'
 LEAPYEAR = 'LEAPYEAR'
 MERIDIEM = 'MERIDIEM'
 MILLISECOND = 'MILLISECOND'
 MINUTE = 'MINUTE'
 MINUTE_SHORT = 'MINUTE_SHORT'
 MONTH = 'MONTH'
 MONTH_DAYS = 'MONTH_DAYS'
 MONTH_DIGIT = 'MONTH_DIGIT'
 MONTH_NAME = 'MONTH_NAME'
 MONTH_NARROW = 'MONTH_NARROW'
 MONTH_SHORT = 'MONTH_SHORT'
 RFC_822 = 'RFC_822'
 RFC_850 = 'RFC_850'
 RFC_1036 = 'RFC_1036'
 RFC_1123 = 'RFC_1123'
 RFC_2822 = 'RFC_2822'
 RFC_3339 = 'RFC_3339'
 RSS = 'RSS'
 SECOND = 'SECOND'
 SECOND_SHORT = 'SECOND_SHORT'
 SWATCH = 'SWATCH'
 TIMES = 'TIMES'
 TIMESTAMP = 'TIMESTAMP'
 TIMEZONE = 'TIMEZONE'
 TIMEZONE_NAME = 'TIMEZONE_NAME'
 TIMEZONE_SECS = 'TIMEZONE_SECS'
 TIME_FULL = 'TIME_FULL'
 TIME_LONG = 'TIME_LONG'
 TIME_MEDIUM = 'TIME_MEDIUM'
 TIME_SHORT = 'TIME_SHORT'
 W3C = 'W3C'
 WEEK = 'WEEK'
 WEEKDAY = 'WEEKDAY'
 WEEKDAY_8601 = 'WEEKDAY_8601'
 WEEKDAY_DIGIT = 'WEEKDAY_DIGIT'
 WEEKDAY_NAME = 'WEEKDAY_NAME'
 WEEKDAY_NARROW = 'WEEKDAY_NARROW'
 WEEKDAY_SHORT = 'WEEKDAY_SHORT'
 YEAR = 'YEAR'
 YEAR_8601 = 'YEAR_8601'
 YEAR_SHORT = 'YEAR_SHORT'
 YEAR_SHORT_8601 = 'YEAR_SHORT_8601'
Method Summary
 static boolean checkLeapYear (integer|Zend_Date $year)
 static Zend_Date now ([string|Zend_Locale $locale = null])
 Zend_Date __construct (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 integer|string add (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 integer|Zend_Date addArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
 Zend_Date addDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
 Zend_Date addDay ( $day, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
 Zend_Date addDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
 Zend_Date addHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
 integer|Zend_Date addIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null], boolean $gmt)
 integer|string addMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
 Zend_Date addMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
 Zend_Date addMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
 Zend_Date addSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null])
 Zend_Date addTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
 Zend_Date addTimestamp (integer|string $timestamp, [string|Zend_Locale $locale = null])
 Zend_Date addWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
 Zend_Date addWeekday ( $weekday, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month, boolean $gmt)
 Zend_Date addYear ( $year, [string|Zend_Locale $locale = null], string|integer|Zend_Date $date)
 integer compare (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 integer compareArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
 Zend_Date compareDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
 integer compareDay (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
 integer compareDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
 integer compareHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
 integer compareIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null], boolean $gmt)
 integer compareMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
 integer compareMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
 integer compareMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
 integer compareSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null])
 integer compareTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
 integer compareTimestamp (integer|string $timestamp, [string|Zend_Locale $locale = null])
 integer compareWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
 integer compareWeekday (string|integer|Zend_Date $weekday, [string|Zend_Locale $locale = null])
 integer compareYear (string|integer|Zend_Date $year, [string|Zend_Locale $locale = null])
 Zend_Date copyPart (string $part, [string|Zend_Locale $locale = null])
 boolean equals (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 integer|string get ([string $part = null], [string|Zend_Locale $locale = null])
 string getArpa ([string|Zend_Locale $locale = null])
 Zend_Date getDate ([string|Zend_Locale $locale = null])
 Zend_Date getDay ([$locale $locale = null])
 Zend_Date getDayOfYear ([string|Zend_Locale $locale = null])
 integer getDst ()
 Zend_Date getHour ([$locale $locale = null])
 string getIso ([string|Zend_Locale $locale = null])
 string getLocale ()
 integer getMilliSecond ()
 Zend_Date getMinute ([string|Zend_Locale $locale = null])
 Zend_Date getMonth ([string|Zend_Locale $locale = null])
 Zend_Date getSecond ([string|Zend_Locale $locale = null])
 array getSunInfo ($location $location)
 Zend_Date getSunRise ($location $location)
 Zend_Date getSunSet ($location $location)
 Zend_Date getTime ([string|Zend_Locale $locale = null])
 integer|string getTimestamp ()
 Zend_Date getWeek ([$locale $locale = null])
 Zend_Date getWeekday ([$locale $locale = null])
 Zend_Date getYear ([string|Zend_Locale $locale = null])
 boolean isEarlier (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 boolean isLater (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 boolean isLeapYear ()
 boolean isToday ()
 boolean isTomorrow ()
 boolean isYesterday ()
 integer|string set (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 integer|Zend_Date setArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
 integer|Zend_Date setDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
 Zend_Date setDay ( $day, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
 Zend_Date setDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
 void setDst ([ $dst = null])
 void setFractionalPrecision (integer $precision)
 Zend_Date setHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
 integer|Zend_Date setIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
 string setLocale ([string|Zend_Locale $locale = null])
 integer|string setMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
 Zend_Date setMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
 Zend_Date setMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
 Zend_Date setSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null])
 Zend_Date setTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
 Zend_Date setTimestamp (integer|string|Zend_Date $timestamp, [string|Zend_Locale $locale = null])
 Zend_Date setWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
 Zend_Date setWeekday ( $weekday, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
 Zend_Date setYear ( $year, [string|Zend_Locale $locale = null], string|integer|Zend_Date $date)
 integer|string sub (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
 integer|Zend_Date subArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
 Zend_Date subDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
 Zend_Date subDay ( $day, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
 Zend_Date subDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
 Zend_Date subHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
 integer|Zend_Date subIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
 integer subMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
 Zend_Date subMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
 Zend_Date subMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
 Zend_Date subSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null], boolean $gmt)
 Zend_Date subTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
 Zend_Date subTimestamp (integer|string $timestamp, [string|Zend_Locale $locale = null])
 Zend_Date subWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
 Zend_Date subWeekday ( $weekday, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
 Zend_Date subYear ( $year, [string|Zend_Locale $locale = null], string|integer|Zend_Date $date)
 string toString ([string $format = null], [string|Zend_Locale $locale = null])
 integer|false toValue ([string|integer|Zend_Date $part = null])
 string __toString ()
Methods
static checkLeapYear (line 2914)

Check a given year for leap year.

  • access: public
static boolean checkLeapYear (integer|Zend_Date $year)
static now (line 2983)

Returns the actual date as new date object

  • access: public
static Zend_Date now ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
Constructor __construct (line 147)

Generates the standard date object, could be a unix timestamp, localized date,

string, integer 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.

  • access: public
  • throws: Zend_Date_Exception
Zend_Date __construct (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date value or value of date part to set, depending on $part
  • string $part: OPTIONAL Defines the input format of $date
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
add (line 1040)

Adds a date or datepart to the existing 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

  • return: new datepart
  • access: public
  • throws: Zend_Date_Exception
integer|string add (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to add
  • string $part: OPTIONAL Part of the date to add, if null the timestamp is added
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addArpa (line 2746)

Adds a RFC 822 date to the date object.

ARPA messages are used in emails or HTTP Headers. Only RFC 822 compilant date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date addArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: RFC 822 Date to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addDate (line 2502)

Adds a date to the existing date object. Format defines how to parse the date string.

If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: MM.dd.YYYY -> 10 -> +10 months

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
  • string|integer|Zend_Date $time: Date to add
  • string $format: OPTIONAL Dateformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $date
addDay (line 3383)

Adds days to the existing date object.

The day can be a number or a string. Adding days lower then 0 or greater than the number of this months days will result in adding or subtracting the relevant month. If a localized dayname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object Example: addDay('Montag', 'de_AT'); will add the number of days until the next monday

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addDay ( $day, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
  • string|integer|Zend_Date $month: Day to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $day
addDayOfYear (line 3643)

Adds a day of year to the existing date object.

The day of year is always a number. Returned is the new date object Example: addDayOfYear(10); will add 10 days to the existing date object.

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $day: Day of Year to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addHour (line 3757)

Adds hours to the existing date object.

The hour is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> addHour(12); -> 05.May.1993 01:07:25

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $hour: Hour to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addIso (line 2625)

Adds a ISO date to the date object. Not given parts are set to default.

Only supported ISO 8601 formats are accepted. For example: 050901 -> + 01.Sept.2005 00:00:00, 10:00:00 -> +10h Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date addIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null], boolean $gmt)
  • string|integer|Zend_Date $date: ISO Date to add
  • boolean $gmt: OPTIONAL true = UTC time, false = actual time zone
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addMilliSecond (line 4100)

Adds milliseconds to the date object

  • access: public
integer|string addMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
  • integer|Zend_Date $milli: OPTIONAL Millisecond to add, when null the actual millisecond is added
  • integer $precision: OPTIONAL Fractional precision for the given milliseconds
addMinute (line 3871)

Adds minutes to the existing date object.

The minute is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> addMinute(65); -> 04.May.1993 13:12:25

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $minute: Minute to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addMonth (line 3245)

Adds months to the existing date object.

The month can be a number or a string. Adding months lower then 0 and greater then 12 will result in adding or subtracting the relevant year. (12 months equal one year) If a localized monthname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $month: Month to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addSecond (line 3986)

Adds seconds to the existing date object.

The second is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> addSecond(65); -> 04.May.1993 13:08:30

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $second: Second to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addTime (line 2371)

Adds a time to the existing date. Format defines how to parse the time string.

If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: HH:mm:ss -> 10 -> +10 hours

  • return: new time
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $time: Time to add
  • string $format: OPTIONAL Timeformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addTimestamp (line 247)

Adds a timestamp

  • access: public
  • throws: Zend_Date_Exception
Zend_Date addTimestamp (integer|string $timestamp, [string|Zend_Locale $locale = null])
  • integer|string $timestamp: Timestamp to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addWeek (line 4281)

Adds a week. The week is always a number. The day of week is not changed.

Returned is the new date object Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25

  • access: public
  • throws: Zend_Date_Exception
Zend_Date addWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $week: Week to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
addWeekday (line 3526)

Adds weekdays to the existing date object.

The weekday can be a number or a string. Adding days lower then 1 or greater than 7 will result in adding or subtracting the relevant number of weeks. 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.

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addWeekday ( $weekday, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month, boolean $gmt)
  • string|integer|Zend_Date $month: Weekday to add
  • boolean $gmt: OPTIONAL true = UTC time, false = actual time zone
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $weekday
addYear (line 3096)

Adds the year to the existing date object

If the year is between 0 and 69, 2000 will be added (2000-2069) If the year if between 70 and 99, 1999 will be added (1970-1999) 3 or 4 digit years are added as expected. If you need to add years from 0-99 use add() instead. Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date addYear ( $year, [string|Zend_Locale $locale = null], string|integer|Zend_Date $date)
  • string|integer|Zend_Date $date: Year to add
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $year
compare (line 1085)

Compares a date or datepart with the existing one.

Returns -1 if earlier, 0 if equal and 1 if later.

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compare (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to compare with the date object
  • string $part: OPTIONAL Part of the date to compare, if null the timestamp is subtracted
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareArpa (line 2782)

Compares a RFC 822 compilant date with the date object.

ARPA messages are used in emails or HTTP Headers. Only RFC 822 compilant date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: RFC 822 Date to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareDate (line 2540)

Compares the date from the existing date object, ignoring the time.

Format defines how to parse the date string. If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: 10.01.2000 => 10.02.1999 -> false

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date compareDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
  • string|integer|Zend_Date $time: Date to compare
  • string $format: OPTIONAL Dateformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $date
compareDay (line 3419)

Compares the day with the existing date object, ignoring other date parts.

For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareDay (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $day: Day to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareDayOfYear (line 3676)

Compares the day of year with the existing date object.

For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $day: Day of Year to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareHour (line 3790)

Compares the hour with the existing date object.

For example: 10:30:25 -> compareHour(10) -> 0 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $hour: Hour to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareIso (line 2660)

Compares a ISO date with the date object. Not given parts are set to default.

Only supported ISO 8601 formats are accepted. For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null], boolean $gmt)
  • string|integer|Zend_Date $date: ISO Date to sub
  • boolean $gmt: OPTIONAL true = UTC time, false = actual time zone
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareMilliSecond (line 4167)

Compares only the millisecond part, returning the difference

  • access: public
integer compareMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
  • integer|Zend_Date $milli: OPTIONAL Millisecond to compare, when null the actual millisecond is compared
  • integer $precision: OPTIONAL Fractional precision for the given milliseconds
compareMinute (line 3904)

Compares the minute with the existing date object.

For example: 10:30:25 -> compareMinute(30) -> 0 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $minute: Hour to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareMonth (line 3280)

Compares the month with the existing date object, ignoring other date parts.

For example: 10.03.2000 -> 15.03.1950 -> true Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $month: Month to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareSecond (line 4020)

Compares the second with the existing date object.

For example: 10:30:25 -> compareSecond(25) -> 0 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $second: Second to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareTime (line 2407)

Compares the time from the existing date. Format defines how to parse the time string.

If only parts are given the other parts are set to default. If no format us given, the standardformat of this locale is used. For example: HH:mm:ss -> 10 -> 10 hours

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $time: Time to compare
  • string $format: OPTIONAL Timeformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareTimestamp (line 275)

Compares two timestamps, returning the difference as integer

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareTimestamp (integer|string $timestamp, [string|Zend_Locale $locale = null])
  • integer|string $timestamp: Timestamp to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareWeek (line 4314)

Compares only the week part, returning the difference

Returned is the new date object Returns if equal, earlier or later Example: 09.Jan.2007 13:07:25 -> compareWeek(2); -> 0

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $week: Week to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareWeekday (line 3563)

Compares the weekday with the existing date object, ignoring other date parts.

For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareWeekday (string|integer|Zend_Date $weekday, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $weekday: Weekday to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
compareYear (line 3131)

Compares the year with the existing date object, ignoring other date parts.

For example: 10.03.2000 -> 15.02.2000 -> true Returns if equal, earlier or later

  • return: 0 = equal, 1 = later, -1 = earlier
  • access: public
  • throws: Zend_Date_Exception
integer compareYear (string|integer|Zend_Date $year, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $year: Year to compare
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
copyPart (line 1114)

Returns a new instance of Zend_Date with the selected part copied.

To make an exact copy, use PHP's clone keyword. For a complete list of supported date part values look into the docu. If a date part is copied, all other date parts are set to standard values. For example: If only YEAR is copied, the returned date object is equal to 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to timestamp 0) If only HOUR is copied, the returned date object is equal to 01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0 plus HOUR).

  • access: public
Zend_Date copyPart (string $part, [string|Zend_Locale $locale = null])
  • string $part: Part of the date to compare, if null the timestamp is subtracted
  • string|Zend_Locale $locale: OPTIONAL New object's locale. No adjustments to timezone are made.
equals (line 2218)

Returns true when both date objects or date parts are equal.

For example: 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false

  • access: public
  • throws: Zend_Date_Exception
boolean equals (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to equal with
  • string $part: OPTIONAL Part of the date to compare, if null the timestamp is used
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
get (line 625)

Returns a representation of a date or datepart This could be for example a localized monthname, the time without date, the era or only the fractional seconds. There are about 50 different supported date parts.

For a complete list of supported datepart values look into the docu

  • return: date or datepart
  • access: public
integer|string get ([string $part = null], [string|Zend_Locale $locale = null])
  • string $part: OPTIONAL Part of the date to return, if null the timestamp is returned
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getArpa (line 2673)

Returns a RFC 822 compilant datestring from the date object.

This function does not return the RFC date as object. Use copy() instead.

  • access: public
string getArpa ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getDate (line 2419)

Returns a clone of $this, with the time part set to 00:00:00.

  • access: public
Zend_Date getDate ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getDay (line 3293)

Returns the day as new date object Example: 20.May.1986 -> 20.Jan.1970 00:00:00

  • access: public
Zend_Date getDay ([$locale $locale = null])
  • $locale $locale: string|Zend_Locale OPTIONAL Locale for parsing input
getDayOfYear (line 3576)

Returns the day of year as new date object Example: 02.Feb.1986 10:00:00 -> 02.Feb.1970 00:00:00

  • access: public
Zend_Date getDayOfYear ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getDst (line 4429)

Returns the actual DST setting

  • access: public
integer getDst ()
getFractionalPrecision (line 4031)

Returns the precision for fractional seconds

  • access: public
integer getFractionalPrecision ()
getHour (line 3689)

Returns the hour as new date object Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00

  • access: public
Zend_Date getHour ([$locale $locale = null])
  • $locale $locale: string|Zend_Locale OPTIONAL Locale for parsing input
getIso (line 2556)

Returns the full ISO 8601 date from the date object.

Always the complete ISO 8601 specifiction is used. If an other ISO date is needed (ISO 8601 defines several formats) use toString() instead. This function does not return the ISO date as object. Use copy() instead.

  • access: public
string getIso ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getLocale (line 4349)

Returns the actual set locale

  • access: public
string getLocale ()
getMilliSecond (line 4057)

Returns the milliseconds of the date object

  • access: public
integer getMilliSecond ()
getMinute (line 3803)

Returns the minute as new date object Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:30:00

  • access: public
Zend_Date getMinute ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getMonth (line 3144)

Returns only the month from the date object as new object.

For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00

  • access: public
Zend_Date getMonth ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getSecond (line 3917)

Returns the second as new date object Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:00:25

  • access: public
Zend_Date getSecond ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getSunInfo (line 2878)

Returns an array with the sunset and sunrise dates for all horizon types For a list of cities and correct locations use the class Zend_Date_Cities

  • return: - [sunset|sunrise][effective|civil|nautic|astronomic]
  • access: public
  • throws: Zend_Date_Exception
array getSunInfo ($location $location)
  • $location $location: array - location of suninfo ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
getSunRise (line 2838)

Returns the time of sunrise for this date and a given location as new date object For a list of cities and correct locations use the class Zend_Date_Cities

  • access: public
  • throws: Zend_Date_Exception
Zend_Date getSunRise ($location $location)
  • $location $location: array - location of sunrise ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
getSunSet (line 2858)

Returns the time of sunset for this date and a given location as new date object For a list of cities and correct locations use the class Zend_Date_Cities

  • access: public
  • throws: Zend_Date_Exception
Zend_Date getSunSet ($location $location)
  • $location $location: array - location of sunset ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
getTime (line 2288)

Returns only the time of the date as new Zend_Date object For example: 15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23

  • access: public
Zend_Date getTime ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
getTimestamp (line 186)

Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP).

If the timestamp is too large for integers, then the return value will be a string. This function does not return the timestamp as an object. Use clone() or copyPart() instead.

  • return: UNIX timestamp
  • access: public
integer|string getTimestamp ()
getWeek (line 4213)

Returns the week as new date object using monday as begining of the week Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00

  • access: public
Zend_Date getWeek ([$locale $locale = null])
  • $locale $locale: string|Zend_Locale OPTIONAL Locale for parsing input
getWeekday (line 3433)

Returns the weekday as new date object Weekday is always from 1-7 Example: 09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also Tuesday)

  • access: public
Zend_Date getWeekday ([$locale $locale = null])
  • $locale $locale: string|Zend_Locale OPTIONAL Locale for parsing input
getYear (line 3023)

Returns only the year from the date object as new object.

For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00

  • access: public
Zend_Date getYear ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
isEarlier (line 2242)

Returns if the given date or datepart is earlier For example: 15.May.2000 <-> 13.June.1999 will return true for day, year and date, but not for month

  • access: public
  • throws: Zend_Date_Exception
boolean isEarlier (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to compare with
  • string $part: OPTIONAL Part of the date to compare, if null the timestamp is used
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
isLater (line 2267)

Returns if the given date or datepart is later

For example: 15.May.2000 <-> 13.June.1999 will return true for month but false for day, year and date Returns if the given date is later

  • access: public
  • throws: Zend_Date_Exception
boolean isLater (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to compare with
  • string $part: OPTIONAL Part of the date to compare, if null the timestamp is used
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
isLeapYear (line 2932)

Returns true, if the year is a leap year.

  • access: public
boolean isLeapYear ()
isToday (line 2943)

Returns if the set date is todays date

  • access: public
boolean isToday ()
isTomorrow (line 2969)

Returns if the set date is tomorrows date

  • access: public
boolean isTomorrow ()
isYesterday (line 2956)

Returns if the set date is yesterdays date

  • access: public
boolean isYesterday ()
set (line 1019)

Sets the given date as new date or a given datepart as new datepart returning the new datepart This could be for example a localized dayname, the date without time, the month or only the seconds. There are about 50 different supported date parts.

For a complete list of supported datepart values look into the docu

  • return: new datepart
  • access: public
  • throws: Zend_Date_Exception
integer|string set (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to set
  • string $part: OPTIONAL Part of the date to set, if null the timestamp is set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setArpa (line 2728)

Sets a RFC 822 date as new date for the date object.

Only RFC 822 compilant date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date setArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: RFC 822 to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setDate (line 2484)

Sets a new date for the date object. Format defines how to parse the date string.

Also a complete date with time can be given, but only the date is used for setting. For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00 Returned is the new date object and the existing time is left as it was before

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date setDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
  • string|integer|Zend_Date $time: Date to set
  • string $format: OPTIONAL Dateformat for parsing
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $date
setDay (line 3363)

Sets a new day The day can be a number or a string. Setting days lower then 0 or greater than the number of this months days will result in adding or subtracting the relevant month.

If a localized dayname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object Example: setDay('Montag', 'de_AT'); will set the monday of this week as day.

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setDay ( $day, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
  • string|integer|Zend_Date $month: Day to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $day
setDayOfYear (line 3626)

Sets a new day of year The day of year is always a number.

Returned is the new date object Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $day: Day of Year to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setDst (line 4441)

Sets a new DST value

NULL = Default behavior FALSE = Do not use summer/wintertime TRUE = Use summer/wintertime

  • access: public
void setDst ([ $dst = null])
  • $dst
setFractionalPrecision (line 4043)

Sets a new precision for fractional seconds

  • access: public
  • throws: Zend_Date_Exception
void setFractionalPrecision (integer $precision)
  • integer $precision: Precision for the fractional datepart 3 = milliseconds
setHour (line 3740)

Sets a new hour The hour is always a number.

Returned is the new date object Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $hour: Hour to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setIso (line 2607)

Sets a new date for the date object. Not given parts are set to default.

Only supported ISO 8601 formats are accepted. For example: 050901 -> 01.Sept.2005 00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date setIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: ISO Date to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setLocale (line 4330)

Sets a new standard locale for the date object.

This locale will be used for all functions Returned is the really set locale. Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist 'xx_YY' will be set to 'root' because 'xx' does not exist

  • access: public
string setLocale ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setMilliSecond (line 4071)

Sets new milliseconds for the date object Example: setMilliSecond(550, 2) -> equals +5 Sec +50 MilliSec

  • access: public
integer|string setMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
  • integer|Zend_Date $milli: OPTIONAL Millisecond to set, when null the actual millisecond is set
  • integer $precision: OPTIONAL Fraction precision of the given milliseconds
setMinute (line 3854)

Sets a new minute The minute is always a number.

Returned is the new date object Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993 13:29:25

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $minute: Minute to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setMonth (line 3226)

Sets a new month

The month can be a number or a string. Setting months lower then 0 and greater then 12 will result in adding or subtracting the relevant year. (12 months equal one year) If a localized monthname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $month: Month to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setSecond (line 3969)

Sets new seconds to the existing date object.

The second is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> setSecond(100); -> 04.May.1993 13:08:40

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $second: Second to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setTime (line 2353)

Sets a new time for the date object. Format defines how to parse the time string.

Also a complete date can be given, but only the time is used for setting. For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44 sec => 1h11min44sec + 1 day Returned is the new date object and the existing date is left as it was before

  • return: new time
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $time: Time to set
  • string $format: OPTIONAL Timeformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setTimestamp (line 233)

Sets a new timestamp

  • access: public
  • throws: Zend_Date_Exception
Zend_Date setTimestamp (integer|string|Zend_Date $timestamp, [string|Zend_Locale $locale = null])
  • integer|string|Zend_Date $timestamp: Timestamp to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setWeek (line 4265)

Sets a new week. The week is always a number. The day of week is not changed.

Returned is the new date object Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25

  • access: public
  • throws: Zend_Date_Exception
Zend_Date setWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $week: Week to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
setWeekday (line 3504)

Sets a new weekday

The weekday can be a number or a string. Specifying a weekday integer lower then 1, or greater than 7 will result in adding or subtracting the relevant number of weekdays to the current date of $this. If a localized weekday name is given, then it will be parsed as a date in $locale (defaults to the same locale as $this). Returned is the new date object. Example: setWeekday(3); will set the wednesday of this week as day.

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setWeekday ( $weekday, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
  • string|integer|Zend_Date $month: Weekday to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $weekday
setYear (line 3077)

Sets a new year

If the year is between 0 and 69, 2000 will be set (2000-2069) If the year if between 70 and 99, 1999 will be set (1970-1999) 3 or 4 digit years are set as expected. If you need to set year 0-99 use set() instead. Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date setYear ( $year, [string|Zend_Locale $locale = null], string|integer|Zend_Date $date)
  • string|integer|Zend_Date $date: Year to set
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $year
sub (line 1064)

Subtracts a date from another date.

This could be for example a RFC2822 date, the time, the year or only the timestamp. There are about 50 different supported date parts. For a complete list of supported datepart values look into the docu Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!!

  • return: new datepart
  • access: public
  • throws: Zend_Date_Exception
integer|string sub (string|integer|Zend_Date $date, [string $part = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: Date or datepart to subtract
  • string $part: OPTIONAL Part of the date to sub, if null the timestamp is subtracted
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subArpa (line 2764)

Subtracts a RFC 822 date from the date object.

ARPA messages are used in emails or HTTP Headers. Only RFC 822 compilant date strings are accepted. For example: Sat, 14 Feb 09 00:31:30 +0100 Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date subArpa (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: RFC 822 Date to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subDate (line 2521)

Subtracts a date from the existing date object. Format defines how to parse the date string.

If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: MM.dd.YYYY -> 10 -> -10 months Be aware: Subtracting 2 months is not equal to Adding -2 months !!!

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subDate ( $date, [string $format = null], [string|Zend_Locale $locale = null], string|integer|Zend_Date $time)
  • string|integer|Zend_Date $time: Date to sub
  • string $format: OPTIONAL Dateformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $date
subDay (line 3403)

Subtracts days from the existing date object.

The day can be a number or a string. Subtracting days lower then 0 or greater than the number of this months days will result in adding or subtracting the relevant month. If a localized dayname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object Example: subDay('Montag', 'de_AT'); will sub the number of days until the previous monday

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subDay ( $day, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
  • string|integer|Zend_Date $month: Day to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $day
subDayOfYear (line 3660)

Subtracts a day of year from the existing date object.

The day of year is always a number. Returned is the new date object Example: subDayOfYear(10); will subtract 10 days from the existing date object.

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subDayOfYear (string|integer|Zend_Date $day, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $day: Day of Year to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subHour (line 3774)

Subtracts hours from the existing date object.

The hour is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> subHour(6); -> 05.May.1993 07:07:25

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subHour (string|integer|Zend_Date $hour, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $hour: Hour to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subIso (line 2642)

Subtracts a ISO date from the date object. Not given parts are set to default.

Only supported ISO 8601 formats are accepted. For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
integer|Zend_Date subIso (string|integer|Zend_Date $date, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $date: ISO Date to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subMilliSecond (line 4154)

Subtracts a millisecond

  • access: public
integer subMilliSecond ([integer|Zend_Date $milli = null], [integer $precision = null])
  • integer|Zend_Date $milli: OPTIONAL Millisecond to sub, when null the actual millisecond is subtracted
  • integer $precision: OPTIONAL Fractional precision for the given milliseconds
subMinute (line 3888)

Subtracts minutes from the existing date object.

The minute is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> subMinute(9); -> 04.May.1993 12:58:25

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subMinute (string|integer|Zend_Date $minute, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $minute: Minute to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subMonth (line 3264)

Subtracts months from the existing date object.

The month can be a number or a string. Subtracting months lower then 0 and greater then 12 will result in adding or subtracting the relevant year. (12 months equal one year) If a localized monthname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subMonth (string|integer|Zend_Date $month, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $month: Month to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subSecond (line 4004)

Subtracts seconds from the existing date object.

The second is always a number. Returned is the new date object Example: 04.May.1993 13:07:25 -> subSecond(10); -> 04.May.1993 13:07:15

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subSecond (string|integer|Zend_Date $second, [string|Zend_Locale $locale = null], boolean $gmt)
  • string|integer|Zend_Date $second: Second to sub
  • boolean $gmt: OPTIONAL true = UTC time, false = actual time zone
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subTime (line 2389)

Subtracts a time from the existing date. Format defines how to parse the time string.

If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: HH:mm:ss -> 10 -> -10 hours

  • return: new time
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subTime (string|integer|Zend_Date $time, [string $format = null], [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $time: Time to sub
  • string $format: OPTIONAL Timeformat for parsing input
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subTimestamp (line 261)

Subtracts a timestamp

  • access: public
  • throws: Zend_Date_Exception
Zend_Date subTimestamp (integer|string $timestamp, [string|Zend_Locale $locale = null])
  • integer|string $timestamp: Timestamp to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subWeek (line 4297)

Subtracts a week. The week is always a number. The day of week is not changed.

Returned is the new date object Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25

  • access: public
  • throws: Zend_Date_Exception
Zend_Date subWeek (string|integer|Zend_Date $week, [string|Zend_Locale $locale = null])
  • string|integer|Zend_Date $week: Week to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
subWeekday (line 3547)

Subtracts weekdays from the existing date object.

The weekday can be a number or a string. Subtracting days lower then 1 or greater than 7 will result in adding or subtracting the relevant number of weeks. 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.

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subWeekday ( $weekday, [string|Zend_Locale $locale = null], string|integer|Zend_Date $month)
  • string|integer|Zend_Date $month: Weekday to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $weekday
subYear (line 3115)

Subs the year from the existing date object

If the year is between 0 and 69, 2000 will be subtracted (2000-2069) If the year if between 70 and 99, 1999 will be subtracted (1970-1999) 3 or 4 digit years are subtracted as expected. If you need to subtract years from 0-99 use sub() instead. Returned is the new date object

  • return: new date
  • access: public
  • throws: Zend_Date_Exception
Zend_Date subYear ( $year, [string|Zend_Locale $locale = null], string|integer|Zend_Date $date)
  • string|integer|Zend_Date $date: Year to sub
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
  • $year
toString (line 297)

Returns a string representation of the object

Supported format tokens are: G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month E - day of week, e - number of weekday, 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

Not supported 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

  • access: public
string toString ([string $format = null], [string|Zend_Locale $locale = null])
  • string $format: OPTIONAL An rule for formatting the output, if null the default dateformat is used
  • string|Zend_Locale $locale: OPTIONAL Locale for parsing input
toValue (line 604)

Returns a integer representation of the object But returns false when the given part is no value f.e. Month-Name

  • access: public
integer|false toValue ([string|integer|Zend_Date $part = null])
  • string|integer|Zend_Date $part: OPTIONAL Defines the date or datepart to return as integer
__toString (line 591)

Returns a string representation of the date which is equal with the timestamp

  • access: public
string __toString ()

Inherited Methods

Inherited From Zend_Date_DateObject

 Zend_Date_DateObject::calcSun()
 Zend_Date_DateObject::date()
 Zend_Date_DateObject::dayOfWeek()
 Zend_Date_DateObject::getDateParts()
 Zend_Date_DateObject::getGmtOffset()
 Zend_Date_DateObject::getTimezone()
 Zend_Date_DateObject::getUnixTimestamp()
 Zend_Date_DateObject::isYearLeapYear()
 Zend_Date_DateObject::mktime()
 Zend_Date_DateObject::setTimezone()
 Zend_Date_DateObject::setUnixTimestamp()
 Zend_Date_DateObject::weekNumber()
Class Constants
ATOM = 'ATOM' (line 123)
COOKIE = 'COOKIE' (line 124)
DATES = 'DATES' (line 113)
DATE_FULL = 'DATE_FULL' (line 114)
DATE_LONG = 'DATE_LONG' (line 115)
DATE_MEDIUM = 'DATE_MEDIUM' (line 116)
DATE_SHORT = 'DATE_SHORT' (line 117)
DAY = 'DAY' (line 51)
DAYLIGHT = 'DAYLIGHT' (line 99)
DAY_OF_YEAR = 'DAY_OF_YEAR' (line 58)
DAY_SHORT = 'DAY_SHORT' (line 53)
DAY_SUFFIX = 'DAY_SUFFIX' (line 56)
ERA = 'ERA' (line 111)
ERA_NAME = 'ERA_NAME' (line 112)
GMT_DIFF = 'GMT_DIFF' (line 100)
GMT_DIFF_SEP = 'GMT_DIFF_SEP' (line 101)
HOUR = 'HOUR' (line 89)
HOUR_AM = 'HOUR_AM' (line 88)
HOUR_SHORT = 'HOUR_SHORT' (line 87)
HOUR_SHORT_AM = 'HOUR_SHORT_AM' (line 86)
ISO_8601 = 'ISO_8601' (line 106)
LEAPYEAR = 'LEAPYEAR' (line 76)
MERIDIEM = 'MERIDIEM' (line 84)
MILLISECOND = 'MILLISECOND' (line 92)
MINUTE = 'MINUTE' (line 90)
MINUTE_SHORT = 'MINUTE_SHORT' (line 94)
MONTH = 'MONTH' (line 67)
MONTH_DAYS = 'MONTH_DAYS' (line 71)
MONTH_DIGIT = 'MONTH_DIGIT' (line 70)
MONTH_NAME = 'MONTH_NAME' (line 69)
MONTH_NARROW = 'MONTH_NARROW' (line 73)
MONTH_SHORT = 'MONTH_SHORT' (line 68)
RFC_822 = 'RFC_822' (line 125)
RFC_850 = 'RFC_850' (line 126)
RFC_1036 = 'RFC_1036' (line 127)
RFC_1123 = 'RFC_1123' (line 128)
RFC_2822 = 'RFC_2822' (line 107)
RFC_3339 = 'RFC_3339' (line 129)
RSS = 'RSS' (line 130)
SECOND = 'SECOND' (line 91)
SECOND_SHORT = 'SECOND_SHORT' (line 95)
SWATCH = 'SWATCH' (line 85)
TIMES = 'TIMES' (line 118)
TIMESTAMP = 'TIMESTAMP' (line 108)
TIMEZONE = 'TIMEZONE' (line 102)
TIMEZONE_NAME = 'TIMEZONE_NAME' (line 98)
TIMEZONE_SECS = 'TIMEZONE_SECS' (line 103)
TIME_FULL = 'TIME_FULL' (line 119)
TIME_LONG = 'TIME_LONG' (line 120)
TIME_MEDIUM = 'TIME_MEDIUM' (line 121)
TIME_SHORT = 'TIME_SHORT' (line 122)
W3C = 'W3C' (line 131)
WEEK = 'WEEK' (line 64)
WEEKDAY = 'WEEKDAY' (line 54)
WEEKDAY_8601 = 'WEEKDAY_8601' (line 55)
WEEKDAY_DIGIT = 'WEEKDAY_DIGIT' (line 57)
WEEKDAY_NAME = 'WEEKDAY_NAME' (line 61)
WEEKDAY_NARROW = 'WEEKDAY_NARROW' (line 60)
WEEKDAY_SHORT = 'WEEKDAY_SHORT' (line 52)
YEAR = 'YEAR' (line 78)
YEAR_8601 = 'YEAR_8601' (line 77)
YEAR_SHORT = 'YEAR_SHORT' (line 79)
YEAR_SHORT_8601 = 'YEAR_SHORT_8601' (line 81)

Documentation generated on Thu, 18 Jan 2007 09:52:41 -0800 by phpDocumentor 1.3.1