Each part of a date or time has a unique constant in Zend_Date.
All constants supported by Zend_Date are listed below.
Table 53. Day Constants
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::DAY |
Day (as number, two digits) | 2009-02-13T14:53:27+01:00 | 13 |
Zend_Date::DAY_SHORT |
Day (as number, one or two digits) | 2009-02-06T14:53:27+01:00 | 6 |
Zend_Date::WEEKDAY |
Weekday (Name of the day, localized, complete) | 2009-02-13T14:53:27+01:00 | Friday |
Zend_Date::WEEKDAY_SHORT |
Weekday (Name of the day, localized, abbreviated, two to four chars) | 2009-02-13T14:53:27+01:00 | Fri for Friday |
Zend_Date::WEEKDAY_NAME |
Weekday (Name of the day, localized, abbreviated, one or two chars) | 2009-02-13T14:53:27+01:00 | Fr for Friday |
Zend_Date::WEEKDAY_NARROW |
Weekday (Name of the day, localized, abbreviated, one char) | 2009-02-13T14:53:27+01:00 | F for Friday |
Zend_Date::WEEKDAY_DIGIT |
Weekday (0 = Sunday, 6 = Saturday) | 2009-02-13T14:53:27+01:00 | 5 for Friday |
Zend_Date::WEEKDAY_8601 |
Weekday according to ISO 8601 (1 = Monday, 7 = Sunday) | 2009-02-13T14:53:27+01:00 | 5 for Friday |
Zend_Date::DAY_OF_YEAR |
Day (as a number, one or two digits) | 2009-02-13T14:53:27+01:00 | 43 |
Zend_Date::DAY_SUFFIX |
English addendum for the day (st, nd, rd, th) | 2009-02-13T14:53:27+01:00 | th |
Table 54. Week Constants
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::WEEK |
Week (as number, 1-53) | 2009-02-13T14:53:27+01:00 | 8 |
Table 55. Month Constants
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::MONTH_NAME |
Month (Name of the month, localized, complete) | 2009-02-13T14:53:27+01:00 | February |
Zend_Date::MONTH_NAME_SHORT |
Month (Name of the month, localized, abbreviated, two to four chars) | 2009-02-13T14:53:27+01:00 | Feb |
Zend_Date::MONTH_NAME_NARROW |
Month (Name of the month, localized, abbreviated, one or two chars) | 2009-02-13T14:53:27+01:00 | F |
Zend_Date::MONTH |
Month (Number of the month, two digits) | 2009-02-13T14:53:27+01:00 | 02 |
Zend_Date::MONTH_SHORT |
Month (Number of the month, one or two digits) | 2009-02-13T14:53:27+01:00 | 2 |
Zend_Date::MONTH_DAYS |
Number of days for this month (number) | 2009-02-13T14:53:27+01:00 | 28 |
Table 56. Year Constants
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::YEAR |
Year (number) | 2009-02-13T14:53:27+01:00 | 2009 |
Zend_Date::YEAR_8601 |
Year according to ISO 8601 (number) | 2009-02-13T14:53:27+01:00 | 2009 |
Zend_Date::YEAR_SHORT |
Year (number, two digits) | 2009-02-13T14:53:27+01:00 | 09 |
Zend_Date::YEAR_SHORT_8601 |
Year according to ISO 8601 (number, two digits) | 2009-02-13T14:53:27+01:00 | 09 |
Zend_Date::LEAPYEAR |
Is the year a leap year? (TRUE or
FALSE)
|
2009-02-13T14:53:27+01:00 | FALSE |
Table 57. Time Constants
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::HOUR |
Hour (00-23, two digits) | 2009-02-13T14:53:27+01:00 | 14 |
Zend_Date::HOUR_SHORT |
Hour (0-23, one or two digits) | 2009-02-13T14:53:27+01:00 | 14 |
Zend_Date::HOUR_SHORT_AM |
Hour (1-12, one or two digits) | 2009-02-13T14:53:27+01:00 | 2 |
Zend_Date::HOUR_AM |
Hour (01-12, two digits) | 2009-02-13T14:53:27+01:00 | 02 |
Zend_Date::MINUTE |
Minute (00-59, two digits) | 2009-02-13T14:53:27+01:00 | 53 |
Zend_Date::MINUTE_SHORT |
Minute (0-59, one or two digits) | 2009-02-13T14:03:27+01:00 | 3 |
Zend_Date::SECOND |
Second (00-59, two digits) | 2009-02-13T14:53:27+01:00 | 27 |
Zend_Date::SECOND_SHORT |
Second (0-59, one or two digits) | 2009-02-13T14:53:07+01:00 | 7 |
Zend_Date::MILLISECOND |
Millisecond (theoretically infinite) | 2009-02-06T14:53:27.20546 | 20546 |
Zend_Date::MERIDIEM |
Time of day (forenoon or afternoon) | 2009-02-13T14:53:27+01:00 | afternoon |
Zend_Date::SWATCH |
Swatch Internet Time | 2009-02-13T14:53:27+01:00 | 620 |
Table 58. Timezone Constants
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::TIMEZONE |
Name der time zone (string, abbreviated) | 2009-02-13T14:53:27+01:00 | CET |
Zend_Date::TIMEZONE_NAME |
Name of the time zone (string, complete) | 2009-02-13T14:53:27+01:00 | Europe/Paris |
Zend_Date::TIMEZONE_SECS |
Difference of the time zone to GMT in seconds (integer) | 2009-02-13T14:53:27+01:00 | 3600 (seconds to GMT) |
Zend_Date::GMT_DIFF |
Difference to GMT in seconds (string) | 2009-02-13T14:53:27+01:00 | +0100 |
Zend_Date::GMT_DIFF_SEP |
Difference to GMT in seconds (string, separated) | 2009-02-13T14:53:27+01:00 | +01:00 |
Zend_Date::DAYLIGHT |
Summer time or Winter time? (TRUE or
FALSE)
|
2009-02-13T14:53:27+01:00 | FALSE |
Table 59. Date Format Constants (formats include timezone)
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::ISO_8601 |
Date according to ISO 8601 (string, complete) | 2009-02-13T14:53:27+01:00 | 2009-02-13T14:53:27+01:00 |
Zend_Date::RFC_2822 |
Date according to RFC 2822 (string) | 2009-02-13T14:53:27+01:00 | Fri, 13 Feb 2009 14:53:27 +0100 |
Zend_Date::TIMESTAMP |
Unix time (seconds since 1.1.1970, mixed) | 2009-02-13T14:53:27+01:00 | 1234533207 |
Zend_Date::ATOM |
Date according to ATOM (string) | 2009-02-13T14:53:27+01:00 | 2009-02-13T14:53:27+01:00 |
Zend_Date::COOKIE |
Date for Cookies (string, for Cookies) | 2009-02-13T14:53:27+01:00 | Friday, 13-Feb-09 14:53:27 Europe/Paris |
Zend_Date::RFC_822 |
Date according to RFC 822 (string) | 2009-02-13T14:53:27+01:00 | Fri, 13 Feb 09 14:53:27 +0100 |
Zend_Date::RFC_850 |
Date according to RFC 850 (string) | 2009-02-13T14:53:27+01:00 | Friday, 13-Feb-09 14:53:27 Europe/Paris |
Zend_Date::RFC_1036 |
Date according to RFC 1036 (string) | 2009-02-13T14:53:27+01:00 | Fri, 13 Feb 09 14:53:27 +0100 |
Zend_Date::RFC_1123 |
Date according to RFC 1123 (string) | 2009-02-13T14:53:27+01:00 | Fri, 13 Feb 2009 14:53:27 +0100 |
Zend_Date::RFC_3339 |
Date according to RFC 3339 (string) | 2009-02-13T14:53:27+01:00 | 2009-02-13T14:53:27+01:00 |
Zend_Date::RSS |
Date for RSS Feeds (string) | 2009-02-13T14:53:27+01:00 | Fri, 13 Feb 2009 14:53:27 +0100 |
Zend_Date::W3C |
Date for HTML or HTTP according to W3C (string) | 2009-02-13T14:53:27+01:00 | 2009-02-13T14:53:27+01:00 |
Especially note Zend_Date::DATES, since this format specifier has
a unique property within Zend_Date as an
input format specifier. When used as an input format for
$part, this constant provides the most flexible acceptance of a
variety of similar date formats. Heuristics are used to automatically extract dates from
an input string and then "fix" simple errors in dates (if any), such as swapping of
years, months, and days, when possible.
Table 60. Date and Time Formats (format varies by locale)
| Constant | Description | Date | Result |
|---|---|---|---|
Zend_Date::ERA |
Epoch (string, localized, abbreviated) | 2009-02-13T14:53:27+01:00 | AD (anno Domini) |
Zend_Date::ERA_NAME |
Epoch (string, localized, complete) | 2009-02-13T14:53:27+01:00 | anno domini (anno Domini) |
Zend_Date::DATES |
Standard date (string, localized, default value). | 2009-02-13T14:53:27+01:00 | 13.02.2009 |
Zend_Date::DATE_FULL |
Complete date (string, localized, complete) | 2009-02-13T14:53:27+01:00 | Friday, 13. February 2009 |
Zend_Date::DATE_LONG |
Long date (string, localized, long) | 2009-02-13T14:53:27+01:00 | 13. February 2009 |
Zend_Date::DATE_MEDIUM |
Normal date (string, localized, normal) | 2009-02-13T14:53:27+01:00 | 13.02.2009 |
Zend_Date::DATE_SHORT |
Abbreviated Date (string, localized, abbreviated) | 2009-02-13T14:53:27+01:00 | 13.02.09 |
Zend_Date::TIMES |
Standard time (string, localized, default value) | 2009-02-13T14:53:27+01:00 | 14:53:27 |
Zend_Date::TIME_FULL |
Complete time (string, localized, complete) | 2009-02-13T14:53:27+01:00 | 14:53 Uhr CET |
Zend_Date::TIME_LONG |
Long time (string, localized, Long) | 2009-02-13T14:53:27+01:00 | 14:53:27 CET |
Zend_Date::TIME_MEDIUM |
Normal time (string, localized, normal) | 2009-02-13T14:53:27+01:00 | 14:53:27 |
Zend_Date::TIME_SHORT |
Abbreviated time (string, localized, abbreviated) | 2009-02-13T14:53:27+01:00 | 14:53 |
Zend_Date::DATETIME |
Standard date with time (string, localized, default value). | 2009-02-13T14:53:27+01:00 | 13.02.2009 14:53:27 |
Zend_Date::DATETIME_FULL |
Complete date with time (string, localized, complete) | 2009-02-13T14:53:27+01:00 | Friday, 13. February 2009 14:53 Uhr CET |
Zend_Date::DATETIME_LONG |
Long date with time (string, localized, long) | 2009-02-13T14:53:27+01:00 | 13. February 2009 14:53:27 CET |
Zend_Date::DATETIME_MEDIUM |
Normal date with time (string, localized, normal) | 2009-02-13T14:53:27+01:00 | 13.02.2009 14:53:27 |
Zend_Date::DATETIME_SHORT |
Abbreviated date with time (string, localized, abbreviated) | 2009-02-13T14:53:27+01:00 | 13.02.09 14:53 |




