For example, the constant Zend_Date::HOUR can be used in the ways
shown below. When working with days of the week, calendar dates, hours, minutes,
seconds, and any other date parts that are expressed differently when in different parts
of the world, the object's timezone will automatically be used to compute the correct
value, even though the internal timestamp is the same for the same moment in time,
regardless of the user's physical location in the world. Regardless of the units
involved, output must be expressed either as GMT or
UTC or localized to a locale. The example output below reflects
localization to Europe/GMT+1 hour (e.g. Germany, Austria, France).
Table 52. Operations Involving Zend_Date::HOUR
| Method | Description | Original date | Result |
|---|---|---|---|
get(Zend_Date::HOUR) |
Output of the hour | 2009-02-13T14:53:27+01:00 | 14 |
set(12, Zend_Date::HOUR) |
Set new hour | 2009-02-13T14:53:27+01:00 | 2009-02-13T12:53:27+01:00 |
add(12, Zend_Date::HOUR) |
Add hours | 2009-02-13T14:53:27+01:00 | 2009-02-14T02:53:27+01:00 |
sub(12, Zend_Date::HOUR) |
Subtract hours | 2009-02-13T14:53:27+01:00 | 2009-02-13T02:53:27+01:00 |
compare(12, Zend_Date::HOUR) |
Compare hour, returns 0, 1 or -1 | 2009-02-13T14:53:27+01:00 | 1 (if object > argument) |
copy(Zend_Date::HOUR) |
Copies only the hour part | 2009-02-13T14:53:27+01:00 | 1970-01-01T14:00:00+01:00 |
equals(14, Zend_Date::HOUR) |
Compares the hour, returns TRUE or
FALSE
|
2009-02-13T14:53:27+01:00 | TRUE |
isEarlier(12, Zend_Date::HOUR) |
Compares the hour, returns TRUE or
FALSE
|
2009-02-13T14:53:27+01:00 | TRUE |
isLater(12, Zend_Date::HOUR) |
Compares the hour, returns TRUE or
FALSE
|
2009-02-13T14:53:27+01:00 | FALSE |




