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

$_monthTable = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)Details- Type
- n/a

$_yearTable = array(1970 => 0, 1960 => -315619200, 1950 => -631152000, 1940 => -946771200, 1930 => -1262304000, 1920 => -1577923200, 1910 => -1893456000, 1900 => -2208988800, 1890 => -2524521600, 1880 => -2840140800, 1870 => -3155673600, 1860 => -3471292800, 1850 => -3786825600, 1840 => -4102444800, 1830 => -4417977600, 1820 => -4733596800, 1810 => -5049129600, 1800 => -5364662400, 1790 => -5680195200, 1780 => -5995814400, 1770 => -6311347200, 1760 => -6626966400, 1750 => -6942499200, 1740 => -7258118400, 1730 => -7573651200, 1720 => -7889270400, 1710 => -8204803200, 1700 => -8520336000, 1690 => -8835868800, 1680 => -9151488000, 1670 => -9467020800, 1660 => -9782640000, 1650 => -10098172800, 1640 => -10413792000, 1630 => -10729324800, 1620 => -11044944000, 1610 => -11360476800, 1600 => -11676096000)array(1970 => 0, 1960 => -315619200, 1950 => -631152000, 1940 => -946771200, 1930 => -1262304000, 1920 => -1577923200, 1910 => -1893456000, 1900 => -2208988800, 1890 => -2524521600, 1880 => -2840140800, 1870 => -3155673600, 1860 => -3471292800, 1850 => -3786825600, 1840 => -4102444800, 1830 => -4417977600, 1820 => -4733596800, 1810 => -5049129600, 1800 => -5364662400, 1790 => -5680195200, 1780 => -5995814400, 1770 => -6311347200, 1760 => -6626966400, 1750 => -6942499200, 1740 => -7258118400, 1730 => -7573651200, 1720 => -7889270400, 1710 => -8204803200, 1700 => -8520336000, 1690 => -8835868800, 1680 => -9151488000, 1670 => -9467020800, 1660 => -9782640000, 1650 => -10098172800, 1640 => -10413792000, 1630 => -10729324800, 1620 => -11044944000, 1610 => -11360476800, 1600 => -11676096000)Details- Type
- n/a
Methods

_getTime(integer $sync = null) : integerInternal function.
| Name | Type | Description |
|---|---|---|
| $sync | integer | OPTIONAL time syncronisation value |
| Type | Description |
|---|---|
| integer | timestamp |

_range(float $a, float $b) : voidInternal _range function Sets the value $a to be in the range of [0, $b]
| Name | Type | Description |
|---|---|---|
| $a | float |
|
| $b | float |
|

calcSun(array $location, bool $horizon, $rise = false) : mixedCalculates the sunrise or sunset based on a location
| Name | Type | Description |
|---|---|---|
| $location | array | Location for calculation MUST include 'latitude', 'longitude', 'horizon' |
| $horizon | bool | true: sunrise; false: sunset |
| $rise |
| Type | Description |
|---|---|
| mixed | - false: midnight sun, integer: |

date(string $format, mixed $timestamp = null, boolean $gmt = false) : stringInternal mktime function used by Zend_Date for handling 64bit timestamps.
| Name | Type | Description |
|---|---|---|
| $format | string | format for output |
| $timestamp | mixed | |
| $gmt | boolean | OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date |
| Type | Description |
|---|---|
| string |

dayOfWeek(integer $year, integer $month, integer $day) : integerReturns the day of week for a Gregorian calendar date.
| Name | Type | Description |
|---|---|---|
| $year | integer | |
| $month | integer | |
| $day | integer |
| Type | Description |
|---|---|
| integer | dayOfWeek |

getDateParts(mixed $timestamp = null, boolean $fast = null) : arrayInternal getDateParts function for handling 64bit timestamps, similar to: http://www.php.net/getdate
| Name | Type | Description |
|---|---|---|
| $timestamp | mixed | |
| $fast | boolean | OPTIONAL defaults to fast (false), resulting in fewer date parts |
| Type | Description |
|---|---|
| array |

getGmtOffset() : integerReturn the offset to GMT of $this object's timezone.
| Type | Description |
|---|---|
| integer | seconds difference between GMT timezone and timezone when object was instantiated |

getTimezone() : stringReturn the timezone of $this object.
| Type | Description |
|---|---|
| string | actual set timezone string |

getUnixTimestamp() : integer | stringReturns this object's UNIX timestamp A timestamp greater then the integer range will be returned as string This function does not return the timestamp as object. Use copy() instead.
| Type | Description |
|---|---|
| integer | string | timestamp |

isYearLeapYear(integer $year) : booleanReturns true, if given $year is a leap year.
| Name | Type | Description |
|---|---|---|
| $year | integer |
| Type | Description |
|---|---|
| boolean | true, if year is leap year |

mktime(integer $hour, integer $minute, integer $second, integer $month, integer $day, integer $year, boolean $gmt = false) : integer | floatInternal mktime function used by Zend_Date.
| Name | Type | Description |
|---|---|---|
| $hour | integer | |
| $minute | integer | |
| $second | integer | |
| $month | integer | |
| $day | integer | |
| $year | integer | |
| $gmt | boolean | OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date |
| Type | Description |
|---|---|
| integer | float | timestamp (number of seconds elapsed relative to 1970/01/01 00:00:00 GMT/UTC) |

setTimezone(string $zone = null) : \Zend_Date_DateObjectSets a new timezone for calculation of $this object's gmt offset.
| Name | Type | Description |
|---|---|---|
| $zone | string | OPTIONAL timezone for date calculation; defaults to date_default_timezone_get() |
| Type | Description |
|---|---|
| \Zend_Date_DateObject | Provides fluent interface |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |

setUnixTimestamp(string | integer $timestamp = null) : string | integerSet this object to have a new UNIX timestamp.
| Name | Type | Description |
|---|---|---|
| $timestamp | string | integer | OPTIONAL timestamp; defaults to local time using time() |
| Type | Description |
|---|---|
| string | integer | old timestamp |
| Exception | Description |
|---|---|
| \Zend_Date_Exception |