Moodle  2.2.1
http://www.collinsharper.com
Zend_Date Class Reference
Inheritance diagram for Zend_Date:
Collaboration diagram for Zend_Date:

Public Member Functions

 __construct ($date=null, $part=null, $locale=null)
 getTimestamp ()
 setTimestamp ($timestamp)
 addTimestamp ($timestamp)
 subTimestamp ($timestamp)
 compareTimestamp ($timestamp)
 toString ($format=null, $type=null, $locale=null)
 __toString ()
 toValue ($part=null)
 toArray ()
 get ($part=null, $locale=null)
 set ($date, $part=null, $locale=null)
 add ($date, $part=self::TIMESTAMP, $locale=null)
 sub ($date, $part=self::TIMESTAMP, $locale=null)
 compare ($date, $part=self::TIMESTAMP, $locale=null)
 copyPart ($part, $locale=null)
 getTimezoneFromString ($zone)
 equals ($date, $part=self::TIMESTAMP, $locale=null)
 isEarlier ($date, $part=null, $locale=null)
 isLater ($date, $part=null, $locale=null)
 getTime ($locale=null)
 setTime ($time, $format=null, $locale=null)
 addTime ($time, $format=null, $locale=null)
 subTime ($time, $format=null, $locale=null)
 compareTime ($time, $format=null, $locale=null)
 getDate ($locale=null)
 setDate ($date, $format=null, $locale=null)
 addDate ($date, $format=null, $locale=null)
 subDate ($date, $format=null, $locale=null)
 compareDate ($date, $format=null, $locale=null)
 getIso ($locale=null)
 setIso ($date, $locale=null)
 addIso ($date, $locale=null)
 subIso ($date, $locale=null)
 compareIso ($date, $locale=null)
 getArpa ($locale=null)
 setArpa ($date, $locale=null)
 addArpa ($date, $locale=null)
 subArpa ($date, $locale=null)
 compareArpa ($date, $locale=null)
 getSunrise ($location)
 getSunset ($location)
 getSunInfo ($location)
 isLeapYear ()
 isToday ()
 isYesterday ()
 isTomorrow ()
 getYear ($locale=null)
 setYear ($year, $locale=null)
 addYear ($year, $locale=null)
 subYear ($year, $locale=null)
 compareYear ($year, $locale=null)
 getMonth ($locale=null)
 setMonth ($month, $locale=null)
 addMonth ($month, $locale=null)
 subMonth ($month, $locale=null)
 compareMonth ($month, $locale=null)
 getDay ($locale=null)
 setDay ($day, $locale=null)
 addDay ($day, $locale=null)
 subDay ($day, $locale=null)
 compareDay ($day, $locale=null)
 getWeekday ($locale=null)
 setWeekday ($weekday, $locale=null)
 addWeekday ($weekday, $locale=null)
 subWeekday ($weekday, $locale=null)
 compareWeekday ($weekday, $locale=null)
 getDayOfYear ($locale=null)
 setDayOfYear ($day, $locale=null)
 addDayOfYear ($day, $locale=null)
 subDayOfYear ($day, $locale=null)
 compareDayOfYear ($day, $locale=null)
 getHour ($locale=null)
 setHour ($hour, $locale=null)
 addHour ($hour, $locale=null)
 subHour ($hour, $locale=null)
 compareHour ($hour, $locale=null)
 getMinute ($locale=null)
 setMinute ($minute, $locale=null)
 addMinute ($minute, $locale=null)
 subMinute ($minute, $locale=null)
 compareMinute ($minute, $locale=null)
 getSecond ($locale=null)
 setSecond ($second, $locale=null)
 addSecond ($second, $locale=null)
 subSecond ($second, $locale=null)
 compareSecond ($second, $locale=null)
 getFractionalPrecision ()
 setFractionalPrecision ($precision)
 getMilliSecond ()
 setMilliSecond ($milli=null, $precision=null)
 addMilliSecond ($milli=null, $precision=null)
 subMilliSecond ($milli=null, $precision=null)
 compareMilliSecond ($milli=null, $precision=null)
 getWeek ($locale=null)
 setWeek ($week, $locale=null)
 addWeek ($week, $locale=null)
 subWeek ($week, $locale=null)
 compareWeek ($week, $locale=null)
 setLocale ($locale=null)
 getLocale ()

Static Public Member Functions

static setOptions (array $options=array())
static getFullYear ($value)
static checkLeapYear ($year)
static now ($locale=null)
static isDate ($date, $format=null, $locale=null)

Data Fields

const DAY = 'dd'
const DAY_SHORT = 'd'
const DAY_SUFFIX = 'SS'
const DAY_OF_YEAR = 'D'
const WEEKDAY = 'EEEE'
const WEEKDAY_SHORT = 'EEE'
const WEEKDAY_NARROW = 'E'
const WEEKDAY_NAME = 'EE'
const WEEKDAY_8601 = 'eee'
const WEEKDAY_DIGIT = 'e'
const WEEK = 'ww'
const MONTH = 'MM'
const MONTH_SHORT = 'M'
const MONTH_DAYS = 'ddd'
const MONTH_NAME = 'MMMM'
const MONTH_NAME_SHORT = 'MMM'
const MONTH_NAME_NARROW = 'MMMMM'
const YEAR = 'y'
const YEAR_SHORT = 'yy'
const YEAR_8601 = 'Y'
const YEAR_SHORT_8601 = 'YY'
const LEAPYEAR = 'l'
const MERIDIEM = 'a'
const SWATCH = 'B'
const HOUR = 'HH'
const HOUR_SHORT = 'H'
const HOUR_AM = 'hh'
const HOUR_SHORT_AM = 'h'
const MINUTE = 'mm'
const MINUTE_SHORT = 'm'
const SECOND = 'ss'
const SECOND_SHORT = 's'
const MILLISECOND = 'S'
const TIMEZONE_NAME = 'zzzz'
const DAYLIGHT = 'I'
const GMT_DIFF = 'Z'
const GMT_DIFF_SEP = 'ZZZZ'
const TIMEZONE = 'z'
const TIMEZONE_SECS = 'X'
const ISO_8601 = 'c'
const RFC_2822 = 'r'
const TIMESTAMP = 'U'
const ERA = 'G'
const ERA_NAME = 'GGGG'
const ERA_NARROW = 'GGGGG'
const DATES = 'F'
const DATE_FULL = 'FFFFF'
const DATE_LONG = 'FFFF'
const DATE_MEDIUM = 'FFF'
const DATE_SHORT = 'FF'
const TIMES = 'WW'
const TIME_FULL = 'TTTTT'
const TIME_LONG = 'TTTT'
const TIME_MEDIUM = 'TTT'
const TIME_SHORT = 'TT'
const DATETIME = 'K'
const DATETIME_FULL = 'KKKKK'
const DATETIME_LONG = 'KKKK'
const DATETIME_MEDIUM = 'KKK'
const DATETIME_SHORT = 'KK'
const ATOM = 'OOO'
const COOKIE = 'CCC'
const RFC_822 = 'R'
const RFC_850 = 'RR'
const RFC_1036 = 'RRR'
const RFC_1123 = 'RRRR'
const RFC_3339 = 'RRRRR'
const RSS = 'SSS'
const W3C = 'WWW'

Static Protected Member Functions

static _getLocalizedToken ($token, $locale)

Detailed Description

Definition at line 36 of file Date.php.


Constructor & Destructor Documentation

__construct ( date = null,
part = null,
locale = null 
)

Generates the standard date object, could be a unix timestamp, localized date, string, integer, array and so on. Also parts of dates or time are supported Always set the default timezone: http://php.net/date_default_timezone_set For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles'); For detailed instructions please look in the docu.

Parameters:
string | integer | Zend_Date | array$dateOPTIONAL Date value or value of date part to set ,depending on $part. If null the actual time is set
string$partOPTIONAL Defines the input format of $date
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date
Exceptions:
Zend_Date_Exception

Definition at line 137 of file Date.php.

Here is the call graph for this function:


Member Function Documentation

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

Returns:
string

Definition at line 473 of file Date.php.

Here is the call graph for this function:

static _getLocalizedToken ( token,
locale 
) [static, protected]

Returns the ISO Token for all localized constants

Parameters:
string$tokenToken to normalize
string$localeLocale to search
Returns:
string

Definition at line 4880 of file Date.php.

Here is the caller graph for this function:

add ( date,
part = self::TIMESTAMP,
locale = null 
)

Adds a date or datepart to the existing date, by extracting $part from $date, and modifying this object by adding that part. The $part is then extracted from this object and returned as an integer or numeric string (for large values, or $part's corresponding to pre-defined formatted date strings). This could be for example a ISO 8601 date, the hour the monthname or only the minute. There are about 50 different supported date parts. For a complete list of supported datepart values look into the docu.

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to add
string$partOPTIONAL Part of the date to add, if null the timestamp is added
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 1096 of file Date.php.

addArpa ( date,
locale = null 
)

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

Parameters:
string | integer | Zend_Date$dateRFC 822 Date to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3195 of file Date.php.

addDate ( date,
format = null,
locale = null 
)

Adds a date to the existing date object. Format defines how to parse the date string. If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: MM.dd.YYYY -> 10 -> +10 months

Parameters:
string | integer | array | Zend_Date$dateDate to add
string$formatOPTIONAL Date format for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3020 of file Date.php.

addDay ( day,
locale = null 
)

Adds days to the existing date object. The day can be a number or a string. Adding days lower then 0 or greater than the number of this months days will result in adding or subtracting the relevant month. If a localized dayname is given it will be parsed with the default locale or the optional set locale.

Parameters:
string | integer | array | Zend_Date$monthDay to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3886 of file Date.php.

addDayOfYear ( day,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dayDay of Year to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4125 of file Date.php.

addHour ( hour,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$hourHour to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4205 of file Date.php.

addIso ( date,
locale = null 
)

Adds a ISO date to the date object. Not given parts are set to default. Only supported ISO 8601 formats are accepted. For example: 050901 -> + 01.Sept.2005 00:00:00, 10:00:00 -> +10h Returned is the new date object

Parameters:
string | integer | Zend_Date$dateISO Date to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3107 of file Date.php.

addMilliSecond ( milli = null,
precision = null 
)

Adds milliseconds to the date object

Parameters:
integer | Zend_Date$milli(Optional) Millisecond to add, when null the actual millisecond is added
integer$precision(Optional) Fractional precision for the given milliseconds
Returns:
Zend_Date Provides fluid interface

Definition at line 4504 of file Date.php.

Here is the call graph for this function:

Here is the caller graph for this function:

addMinute ( minute,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$minuteMinute to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4291 of file Date.php.

addMonth ( month,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$monthMonth to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3743 of file Date.php.

addSecond ( second,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$secondSecond to add
string | Zend_Locale$locale(Optional) Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4377 of file Date.php.

Here is the caller graph for this function:

addTime ( time,
format = null,
locale = null 
)

Adds a time to the existing date. Format defines how to parse the time string. If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: HH:mm:ss -> 10 -> +10 hours

Parameters:
string | integer | array | Zend_Date$timeTime to add
string$formatOPTIONAL Timeformat for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 2858 of file Date.php.

addTimestamp ( timestamp)

Adds a timestamp

Parameters:
integer | string | array | Zend_Date$timestampTimestamp to add
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 371 of file Date.php.

Here is the caller graph for this function:

addWeek ( week,
locale = null 
)

Adds a week. The week is always a number. The day of week is not changed. Returned is the new date object Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25

Parameters:
string | integer | array | Zend_Date$weekWeek to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4658 of file Date.php.

addWeekday ( weekday,
locale = null 
)

Adds weekdays to the existing date object. The weekday can be a number or a string. If a localized dayname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object Example: addWeekday(3); will add the difference of days from the begining of the month until wednesday.

Parameters:
string | integer | array | Zend_Date$monthWeekday to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4036 of file Date.php.

addYear ( year,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateYear to add
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3581 of file Date.php.

static checkLeapYear ( year) [static]

Check a given year for leap year.

Parameters:
integer | array | Zend_Date$yearYear to check
Returns:
boolean

Definition at line 3366 of file Date.php.

Here is the call graph for this function:

Here is the caller graph for this function:

compare ( date,
part = self::TIMESTAMP,
locale = null 
)

Compares a date or datepart with the existing one. Returns -1 if earlier, 0 if equal and 1 if later.

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to compare with the date object
string$partOPTIONAL Part of the date to compare, if null the timestamp is subtracted
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 1139 of file Date.php.

Here is the caller graph for this function:

compareArpa ( date,
locale = null 
)

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

Parameters:
string | integer | Zend_Date$dateRFC 822 Date to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 3231 of file Date.php.

compareDate ( date,
format = null,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateDate to compare
string$formatOPTIONAL Date format for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 3058 of file Date.php.

compareDay ( day,
locale = null 
)

Compares the day with the existing date object, ignoring other date parts. For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$dayDay to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 3920 of file Date.php.

compareDayOfYear ( day,
locale = null 
)

Compares the day of year with the existing date object. For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0 Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$dayDay of Year to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 4158 of file Date.php.

compareHour ( hour,
locale = null 
)

Compares the hour with the existing date object. For example: 10:30:25 -> compareHour(10) -> 0 Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$hourHour to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 4238 of file Date.php.

compareIso ( date,
locale = null 
)

Compares a ISO date with the date object. Not given parts are set to default. Only supported ISO 8601 formats are accepted. For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h Returns if equal, earlier or later

Parameters:
string | integer | Zend_Date$dateISO Date to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 3141 of file Date.php.

compareMilliSecond ( milli = null,
precision = null 
)

Compares only the millisecond part, returning the difference

Parameters:
integer | Zend_Date$milliOPTIONAL Millisecond to compare, when null the actual millisecond is compared
integer$precisionOPTIONAL Fractional precision for the given milliseconds
Exceptions:
Zend_Date_ExceptionOn invalid input
Returns:
integer 0 = equal, 1 = later, -1 = earlier

Definition at line 4574 of file Date.php.

compareMinute ( minute,
locale = null 
)

Compares the minute with the existing date object. For example: 10:30:25 -> compareMinute(30) -> 0 Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$minuteHour to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 4324 of file Date.php.

compareMonth ( month,
locale = null 
)

Compares the month with the existing date object, ignoring other date parts. For example: 10.03.2000 -> 15.03.1950 -> true Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$monthMonth to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 3778 of file Date.php.

compareSecond ( second,
locale = null 
)

Compares the second with the existing date object. For example: 10:30:25 -> compareSecond(25) -> 0 Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$secondSecond to compare
string | Zend_Locale$locale(Optional) Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 4410 of file Date.php.

compareTime ( time,
format = null,
locale = null 
)

Compares the time from the existing date. Format defines how to parse the time string. If only parts are given the other parts are set to default. If no format us given, the standardformat of this locale is used. For example: HH:mm:ss -> 10 -> 10 hours

Parameters:
string | integer | array | Zend_Date$timeTime to compare
string$formatOPTIONAL Timeformat for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 2894 of file Date.php.

compareTimestamp ( timestamp)

Compares two timestamps, returning the difference as integer

Parameters:
integer | string | array | Zend_Date$timestampTimestamp to compare
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 395 of file Date.php.

compareWeek ( week,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$weekWeek to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier

Definition at line 4688 of file Date.php.

compareWeekday ( weekday,
locale = null 
)

Compares the weekday with the existing date object, ignoring other date parts. For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$weekdayWeekday to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 4072 of file Date.php.

compareYear ( year,
locale = null 
)

Compares the year with the existing date object, ignoring other date parts. For example: 10.03.2000 -> 15.02.2000 -> true Returns if equal, earlier or later

Parameters:
string | integer | array | Zend_Date$yearYear to compare
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
integer 0 = equal, 1 = later, -1 = earlier
Exceptions:
Zend_Date_Exception

Definition at line 3616 of file Date.php.

copyPart ( part,
locale = null 
)

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

Parameters:
string$partPart of the date to compare, if null the timestamp is subtracted
string | Zend_Locale$localeOPTIONAL New object's locale. No adjustments to timezone are made.
Returns:
Zend_Date New clone with requested part

Definition at line 1169 of file Date.php.

Here is the caller graph for this function:

equals ( date,
part = self::TIMESTAMP,
locale = null 
)

Returns true when both date objects or date parts are equal. For example: 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to equal with
string$partOPTIONAL Part of the date to compare, if null the timestamp is used
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
boolean
Exceptions:
Zend_Date_Exception

Definition at line 2682 of file Date.php.

Here is the call graph for this function:

get ( part = null,
locale = null 
)

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

Parameters:
string$partOPTIONAL Part of the date to return, if null the timestamp is returned
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
string date or datepart

Definition at line 526 of file Date.php.

Here is the call graph for this function:

getArpa ( locale = null)

Returns a RFC 822 compilant datestring from the date object. This function does not return the RFC date as object. Use copy() instead.

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
string

Definition at line 3154 of file Date.php.

Here is the call graph for this function:

getDate ( locale = null)

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

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 2905 of file Date.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDay ( locale = null)

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

Parameters:
$localestring|Zend_Locale OPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 3791 of file Date.php.

Here is the call graph for this function:

getDayOfYear ( locale = null)

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

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 4085 of file Date.php.

Here is the call graph for this function:

Returns the precision for fractional seconds

Returns:
integer

Definition at line 4421 of file Date.php.

static getFullYear ( value) [static]

Counts the exact year number < 70 - 2000 added, >70 < 100 - 1900, others just returned

Parameters:
integer$valueyear number
Returns:
integer Number of year

Definition at line 1044 of file Date.php.

getHour ( locale = null)

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

Parameters:
$localestring|Zend_Locale OPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 4171 of file Date.php.

Here is the call graph for this function:

getIso ( locale = null)

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

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
string

Definition at line 3073 of file Date.php.

Here is the call graph for this function:

getLocale ( )

Returns the actual set locale

Returns:
string

Definition at line 4721 of file Date.php.

Here is the caller graph for this function:

Returns the milliseconds of the date object

Returns:
string

Definition at line 4457 of file Date.php.

getMinute ( locale = null)

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

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 4251 of file Date.php.

Here is the call graph for this function:

getMonth ( locale = null)

Returns only the month from the date object as new object. For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 3629 of file Date.php.

Here is the call graph for this function:

getSecond ( locale = null)

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

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 4337 of file Date.php.

Here is the call graph for this function:

getSunInfo ( location)

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

Parameters:
$locationarray - location of suninfo ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
Returns:
array - [sunset|sunrise][effective|civil|nautic|astronomic]
Exceptions:
Zend_Date_Exception

Definition at line 3330 of file Date.php.

Here is the call graph for this function:

getSunrise ( location)

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

Parameters:
$locationarray - location of sunrise ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
Returns:
Zend_Date
Exceptions:
Zend_Date_Exception

Definition at line 3290 of file Date.php.

Here is the call graph for this function:

getSunset ( location)

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

Parameters:
$locationarray - location of sunset ['horizon'] -> civil, nautic, astronomical, effective (default) ['longitude'] -> longitude of location ['latitude'] -> latitude of location
Returns:
Zend_Date
Exceptions:
Zend_Date_Exception

Definition at line 3310 of file Date.php.

Here is the call graph for this function:

getTime ( locale = null)

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

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 2746 of file Date.php.

Here is the call graph for this function:

Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP). If the timestamp is too large for integers, then the return value will be a string. This function does not return the timestamp as an object. Use clone() or copyPart() instead.

Returns:
integer|string UNIX timestamp

Definition at line 311 of file Date.php.

Here is the call graph for this function:

getTimezoneFromString ( zone)

Internal function, returns the offset of a given timezone

Parameters:
string$zone
Returns:
integer

Definition at line 1186 of file Date.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getWeek ( locale = null)

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

Parameters:
$localestring|Zend_Locale OPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 4622 of file Date.php.

Here is the call graph for this function:

getWeekday ( locale = null)

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

Parameters:
$localestring|Zend_Locale OPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 3934 of file Date.php.

Here is the call graph for this function:

getYear ( locale = null)

Returns only the year from the date object as new object. For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 3537 of file Date.php.

Here is the call graph for this function:

static isDate ( date,
format = null,
locale = null 
) [static]

Checks if the given date is a real date or datepart. Returns false if a expected datepart is missing or a datepart exceeds its possible border. But the check will only be done for the expected dateparts which are given by format. If no format is given the standard dateformat for the actual locale is used. f.e. 30.February.2007 will return false if format is 'dd.MMMM.YYYY'

Parameters:
string | array | Zend_Date$dateDate to parse for correctness
string$format(Optional) Format for parsing the date string
string | Zend_Locale$locale(Optional) Locale for parsing date parts
Returns:
boolean True when all date parts are correct

Definition at line 4738 of file Date.php.

Here is the call graph for this function:

Here is the caller graph for this function:

isEarlier ( date,
part = null,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to compare with
string$partOPTIONAL Part of the date to compare, if null the timestamp is used
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
boolean
Exceptions:
Zend_Date_Exception

Definition at line 2704 of file Date.php.

Here is the call graph for this function:

isLater ( date,
part = null,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to compare with
string$partOPTIONAL Part of the date to compare, if null the timestamp is used
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
boolean
Exceptions:
Zend_Date_Exception

Definition at line 2727 of file Date.php.

Here is the call graph for this function:

Returns true, if the year is a leap year.

Returns:
boolean

Definition at line 3395 of file Date.php.

Here is the call graph for this function:

isToday ( )

Returns if the set date is todays date

Returns:
boolean

Definition at line 3406 of file Date.php.

Here is the call graph for this function:

Returns if the set date is tomorrows date

Returns:
boolean

Definition at line 3434 of file Date.php.

Here is the call graph for this function:

Returns if the set date is yesterdays date

Returns:
boolean

Definition at line 3419 of file Date.php.

Here is the call graph for this function:

static now ( locale = null) [static]

Returns the actual date as new date object

Parameters:
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date

Definition at line 3449 of file Date.php.

Here is the caller graph for this function:

set ( date,
part = null,
locale = null 
)

Sets the given date as new date or a given datepart as new datepart returning the new datepart This could be for example a localized dayname, the date without time, the month or only the seconds. There are about 50 different supported date parts. For a complete list of supported datepart values look into the docu

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to set
string$partOPTIONAL Part of the date to set, if null the timestamp is set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 1068 of file Date.php.

Here is the call graph for this function:

setArpa ( date,
locale = null 
)

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

Parameters:
string | integer | Zend_Date$dateRFC 822 to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3177 of file Date.php.

setDate ( date,
format = null,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateDate to set
string$formatOPTIONAL Date format for parsing
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3002 of file Date.php.

setDay ( day,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$monthDay to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3868 of file Date.php.

setDayOfYear ( day,
locale = null 
)

Sets a new day of year The day of year is always a number. Returned is the new date object Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004

Parameters:
string | integer | array | Zend_Date$dayDay of Year to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4108 of file Date.php.

setFractionalPrecision ( precision)

Sets a new precision for fractional seconds

Parameters:
integer$precisionPrecision for the fractional datepart 3 = milliseconds
Exceptions:
Zend_Date_Exception
Returns:
Zend_Date Provides fluid interface

Definition at line 4434 of file Date.php.

setHour ( hour,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$hourHour to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4188 of file Date.php.

setIso ( date,
locale = null 
)

Sets a new date for the date object. Not given parts are set to default. Only supported ISO 8601 formats are accepted. For example: 050901 -> 01.Sept.2005 00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s Returned is the new date object

Parameters:
string | integer | Zend_Date$dateISO Date to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3090 of file Date.php.

setLocale ( locale = null)

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

Parameters:
string | Zend_Locale$locale(Optional) Locale for parsing input
Exceptions:
Zend_Date_ExceptionWhen the given locale does not exist
Returns:
Zend_Date Provides fluent interface

Definition at line 4704 of file Date.php.

Here is the caller graph for this function:

setMilliSecond ( milli = null,
precision = null 
)

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

Parameters:
integer | Zend_Date$milli(Optional) Millisecond to set, when null the actual millisecond is set
integer$precision(Optional) Fraction precision of the given milliseconds
Returns:
Zend_Date Provides fluid interface

Definition at line 4471 of file Date.php.

Here is the call graph for this function:

setMinute ( minute,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$minuteMinute to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4274 of file Date.php.

setMonth ( month,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$monthMonth to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3724 of file Date.php.

static setOptions ( array options = array()) [static]

Sets class wide options, if no option was given, the actual set options will be returned

Parameters:
array$optionsOptions to set
Exceptions:
Zend_Date_Exception
Returns:
Options array if no option was given

Definition at line 238 of file Date.php.

setSecond ( second,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$secondSecond to set
string | Zend_Locale$locale(Optional) Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4360 of file Date.php.

setTime ( time,
format = null,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$timeTime to set
string$formatOPTIONAL Timeformat for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 2840 of file Date.php.

setTimestamp ( timestamp)

Sets a new timestamp

Parameters:
integer | string | array | Zend_Date$timestampTimestamp to set
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 359 of file Date.php.

setWeek ( week,
locale = null 
)

Sets a new week. The week is always a number. The day of week is not changed. Returned is the new date object Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25

Parameters:
string | integer | array | Zend_Date$weekWeek to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4643 of file Date.php.

setWeekday ( weekday,
locale = null 
)

Sets a new weekday The weekday can be a number or a string. If a localized weekday name is given, then it will be parsed as a date in $locale (defaults to the same locale as $this). Returned is the new date object. Example: setWeekday(3); will set the wednesday of this week as day.

Parameters:
string | integer | array | Zend_Date$monthWeekday to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4016 of file Date.php.

setYear ( year,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateYear to set
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3562 of file Date.php.

sub ( date,
part = self::TIMESTAMP,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateDate or datepart to subtract
string$partOPTIONAL Part of the date to sub, if null the timestamp is subtracted
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 1119 of file Date.php.

subArpa ( date,
locale = null 
)

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

Parameters:
string | integer | Zend_Date$dateRFC 822 Date to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3213 of file Date.php.

subDate ( date,
format = null,
locale = null 
)

Subtracts a date from the existing date object. Format defines how to parse the date string. If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: MM.dd.YYYY -> 10 -> -10 months Be aware: Subtracting 2 months is not equal to Adding -2 months !!!

Parameters:
string | integer | array | Zend_Date$dateDate to sub
string$formatOPTIONAL Date format for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3039 of file Date.php.

subDay ( day,
locale = null 
)

Subtracts days from the existing date object. The day can be a number or a string. Subtracting days lower then 0 or greater than the number of this months days will result in adding or subtracting the relevant month. If a localized dayname is given it will be parsed with the default locale or the optional set locale.

Parameters:
string | integer | array | Zend_Date$monthDay to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3904 of file Date.php.

subDayOfYear ( day,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dayDay of Year to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4142 of file Date.php.

subHour ( hour,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$hourHour to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4222 of file Date.php.

subIso ( date,
locale = null 
)

Subtracts a ISO date from the date object. Not given parts are set to default. Only supported ISO 8601 formats are accepted. For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h Returned is the new date object

Parameters:
string | integer | Zend_Date$dateISO Date to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3124 of file Date.php.

subMilliSecond ( milli = null,
precision = null 
)

Subtracts a millisecond

Parameters:
integer | Zend_Date$milli(Optional) Millisecond to sub, when null the actual millisecond is subtracted
integer$precision(Optional) Fractional precision for the given milliseconds
Returns:
Zend_Date Provides fluid interface

Definition at line 4560 of file Date.php.

Here is the call graph for this function:

subMinute ( minute,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$minuteMinute to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4308 of file Date.php.

subMonth ( month,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$monthMonth to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3762 of file Date.php.

subSecond ( second,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$secondSecond to sub
string | Zend_Locale$locale(Optional) Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4394 of file Date.php.

Here is the caller graph for this function:

subTime ( time,
format = null,
locale = null 
)

Subtracts a time from the existing date. Format defines how to parse the time string. If only parts are given the other parts are set to 0. If no format is given, the standardformat of this locale is used. For example: HH:mm:ss -> 10 -> -10 hours

Parameters:
string | integer | array | Zend_Date$timeTime to sub
string$formatOPTIONAL Timeformat for parsing input
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid inteface
Exceptions:
Zend_Date_Exception

Definition at line 2876 of file Date.php.

subTimestamp ( timestamp)

Subtracts a timestamp

Parameters:
integer | string | array | Zend_Date$timestampTimestamp to sub
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 383 of file Date.php.

Here is the caller graph for this function:

subWeek ( week,
locale = null 
)

Subtracts a week. The week is always a number. The day of week is not changed. Returned is the new date object Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25

Parameters:
string | integer | array | Zend_Date$weekWeek to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4673 of file Date.php.

subWeekday ( weekday,
locale = null 
)

Subtracts weekdays from the existing date object. The weekday can be a number or a string. If a localized dayname is given it will be parsed with the default locale or the optional set locale. Returned is the new date object Example: subWeekday(3); will subtract the difference of days from the begining of the month until wednesday.

Parameters:
string | integer | array | Zend_Date$monthWeekday to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 4056 of file Date.php.

subYear ( year,
locale = null 
)

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

Parameters:
string | integer | array | Zend_Date$dateYear to sub
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
Zend_Date Provides fluid interface
Exceptions:
Zend_Date_Exception

Definition at line 3600 of file Date.php.

toArray ( )

Returns an array representation of the object

Returns:
array

Definition at line 500 of file Date.php.

Here is the call graph for this function:

toString ( format = null,
type = null,
locale = null 
)

Returns a string representation of the object Supported format tokens are: G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month E - day of week, e - number of weekday (1-7), h - hour 1-12, H - hour 0-23, m - minute, s - second A - milliseconds of day, z - timezone, Z - timezone offset, S - fractional second, a - period of day

Additionally format tokens but non ISO conform are: SS - day suffix, eee - php number of weekday(0-6), ddd - number of days per month l - Leap year, B - swatch internet time, I - daylight saving time, X - timezone offset in seconds r - RFC2822 format, U - unix timestamp

Not supported ISO tokens are u - extended year, Q - quarter, q - quarter, L - stand alone month, W - week of month F - day of week of month, g - modified julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24 v - wall zone

Parameters:
string$formatOPTIONAL Rule for formatting output. If null the default date format is used
string$typeOPTIONAL Type for the format string which overrides the standard setting
string | Zend_Locale$localeOPTIONAL Locale for parsing input
Returns:
string

Definition at line 422 of file Date.php.

Here is the call graph for this function:

Here is the caller graph for this function:

toValue ( part = null)

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

Parameters:
string | integer | Zend_Date$partOPTIONAL Defines the date or datepart to return as integer
Returns:
integer|false

Definition at line 485 of file Date.php.


Field Documentation

const ATOM = 'OOO'

Definition at line 113 of file Date.php.

const COOKIE = 'CCC'

Definition at line 114 of file Date.php.

const DATE_FULL = 'FFFFF'

Definition at line 99 of file Date.php.

const DATE_LONG = 'FFFF'

Definition at line 100 of file Date.php.

const DATE_MEDIUM = 'FFF'

Definition at line 101 of file Date.php.

const DATE_SHORT = 'FF'

Definition at line 102 of file Date.php.

const DATES = 'F'

Definition at line 98 of file Date.php.

const DATETIME = 'K'

Definition at line 108 of file Date.php.

const DATETIME_FULL = 'KKKKK'

Definition at line 109 of file Date.php.

const DATETIME_LONG = 'KKKK'

Definition at line 110 of file Date.php.

const DATETIME_MEDIUM = 'KKK'

Definition at line 111 of file Date.php.

const DATETIME_SHORT = 'KK'

Definition at line 112 of file Date.php.

const DAY = 'dd'

Definition at line 53 of file Date.php.

const DAY_OF_YEAR = 'D'

Definition at line 56 of file Date.php.

const DAY_SHORT = 'd'

Definition at line 54 of file Date.php.

const DAY_SUFFIX = 'SS'

Definition at line 55 of file Date.php.

const DAYLIGHT = 'I'

Definition at line 87 of file Date.php.

const ERA = 'G'

Definition at line 95 of file Date.php.

const ERA_NAME = 'GGGG'

Definition at line 96 of file Date.php.

const ERA_NARROW = 'GGGGG'

Definition at line 97 of file Date.php.

const GMT_DIFF = 'Z'

Definition at line 88 of file Date.php.

const GMT_DIFF_SEP = 'ZZZZ'

Definition at line 89 of file Date.php.

const HOUR = 'HH'

Definition at line 77 of file Date.php.

const HOUR_AM = 'hh'

Definition at line 79 of file Date.php.

const HOUR_SHORT = 'H'

Definition at line 78 of file Date.php.

const HOUR_SHORT_AM = 'h'

Definition at line 80 of file Date.php.

const ISO_8601 = 'c'

Definition at line 92 of file Date.php.

const LEAPYEAR = 'l'

Definition at line 74 of file Date.php.

const MERIDIEM = 'a'

Definition at line 75 of file Date.php.

const MILLISECOND = 'S'

Definition at line 85 of file Date.php.

const MINUTE = 'mm'

Definition at line 81 of file Date.php.

const MINUTE_SHORT = 'm'

Definition at line 82 of file Date.php.

const MONTH = 'MM'

Definition at line 64 of file Date.php.

const MONTH_DAYS = 'ddd'

Definition at line 66 of file Date.php.

const MONTH_NAME = 'MMMM'

Definition at line 67 of file Date.php.

const MONTH_NAME_NARROW = 'MMMMM'

Definition at line 69 of file Date.php.

const MONTH_NAME_SHORT = 'MMM'

Definition at line 68 of file Date.php.

const MONTH_SHORT = 'M'

Definition at line 65 of file Date.php.

const RFC_1036 = 'RRR'

Definition at line 117 of file Date.php.

const RFC_1123 = 'RRRR'

Definition at line 118 of file Date.php.

const RFC_2822 = 'r'

Definition at line 93 of file Date.php.

const RFC_3339 = 'RRRRR'

Definition at line 119 of file Date.php.

const RFC_822 = 'R'

Definition at line 115 of file Date.php.

const RFC_850 = 'RR'

Definition at line 116 of file Date.php.

const RSS = 'SSS'

Definition at line 120 of file Date.php.

const SECOND = 'ss'

Definition at line 83 of file Date.php.

const SECOND_SHORT = 's'

Definition at line 84 of file Date.php.

const SWATCH = 'B'

Definition at line 76 of file Date.php.

const TIME_FULL = 'TTTTT'

Definition at line 104 of file Date.php.

const TIME_LONG = 'TTTT'

Definition at line 105 of file Date.php.

const TIME_MEDIUM = 'TTT'

Definition at line 106 of file Date.php.

const TIME_SHORT = 'TT'

Definition at line 107 of file Date.php.

const TIMES = 'WW'

Definition at line 103 of file Date.php.

const TIMESTAMP = 'U'

Definition at line 94 of file Date.php.

const TIMEZONE = 'z'

Definition at line 90 of file Date.php.

const TIMEZONE_NAME = 'zzzz'

Definition at line 86 of file Date.php.

const TIMEZONE_SECS = 'X'

Definition at line 91 of file Date.php.

const W3C = 'WWW'

Definition at line 121 of file Date.php.

const WEEK = 'ww'

Definition at line 63 of file Date.php.

const WEEKDAY = 'EEEE'

Definition at line 57 of file Date.php.

const WEEKDAY_8601 = 'eee'

Definition at line 61 of file Date.php.

const WEEKDAY_DIGIT = 'e'

Definition at line 62 of file Date.php.

const WEEKDAY_NAME = 'EE'

Definition at line 60 of file Date.php.

const WEEKDAY_NARROW = 'E'

Definition at line 59 of file Date.php.

const WEEKDAY_SHORT = 'EEE'

Definition at line 58 of file Date.php.

const YEAR = 'y'

Definition at line 70 of file Date.php.

const YEAR_8601 = 'Y'

Definition at line 72 of file Date.php.

const YEAR_SHORT = 'yy'

Definition at line 71 of file Date.php.

const YEAR_SHORT_8601 = 'YY'

Definition at line 73 of file Date.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations