category | Zend |
---|---|
package | Zend_Date |
subpackage | Zend_Date_DateObject |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
getGmtOffset() : integer
The offset to GMT is initially set when the object is instantiated using the currently, in effect, default timezone for PHP functions.
integer
seconds difference between GMT timezone and timezone when object was instantiatedgetTimezone() : string
The timezone is initially set when the object is instantiated.
string
actual set timezone stringsetTimezone(string $zone = null
) : \Zend_Date_DateObject
For a list of supported timezones look here: http://php.net/timezones If no timezone can be detected or the given timezone is wrong UTC will be set.
string
OPTIONAL timezone for date calculation; defaults to date_default_timezone_get()
\Zend_Date_Exception |
---|
\Zend_Date_DateObject
Provides fluent interface_getTagSupportForCache()
_getTime(integer $sync = null
) : integer
Returns time(). This method exists to allow unit tests to work-around methods that might otherwise be hard-coded to use time(). For example, this makes it possible to test isYesterday() in Date.php.
integer
OPTIONAL time syncronisation value
integer
timestampcalcSun(array $location, boolean $horizon, $rise = false
) : mixed
array
Location for calculation MUST include 'latitude', 'longitude', 'horizon'
boolean
true: sunrise; false: sunset
mixed
- false: midnight sun, integer:date(string $format, mixed $timestamp= null
, boolean $gmt= false
) : string
Returns a formatted date for a given timestamp.
string
format for output
mixed
boolean
OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
string
dayOfWeek(integer $year, integer $month, integer $day) : integer
0 = sunday, 6 = saturday
integer
integer
integer
integer
dayOfWeekgetDateParts(mixed $timestamp= null
, boolean $fast= null
) : array
Returns an array of date parts for $timestamp, relative to 1970/01/01 00:00:00 GMT/UTC.
$fast specifies ALL date parts should be returned (slower) Default is false, and excludes $dayofweek, weekday, month and timestamp from parts returned.
mixed
boolean
OPTIONAL defaults to fast (false), resulting in fewer date parts
array
getUnixTimestamp() : integer | string
integer
string
timestampisYearLeapYear(integer $year) : boolean
integer
boolean
true, if year is leap yearmktime(integer $hour, integer $minute, integer $second, integer $month, integer $day, integer $year, boolean $gmt = false
) : integer | float
The timestamp returned by mktime() can exceed the precision of traditional UNIX timestamps, by allowing PHP to auto-convert to using a float value.
Returns a timestamp relative to 1970/01/01 00:00:00 GMT/UTC. DST (Summer/Winter) is depriciated since php 5.1.0. Year has to be 4 digits otherwise it would be recognised as year 70 AD instead of 1970 AD as expected !!
integer
integer
integer
integer
integer
integer
boolean
OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
integer
float
timestamp (number of seconds elapsed relative to 1970/01/01 00:00:00 GMT/UTC)setUnixTimestamp(string|integer $timestamp = null
) : string | integer
string
integer
OPTIONAL timestamp; defaults to local time using time()
\Zend_Date_Exception |
---|
string
integer
old timestampweekNumber(integer $year, integer $month, integer $day) : integer
Returns the ISO 8601 week number of a given date
integer
integer
integer
integer
_range(float $a, float $b)
float
float
$_cache
null
$_cacheTags
false
$_defaultOffset
0
$_dst
true
$_monthTable
array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
$_offset
0
$_syncronised
0
$_timezone
'UTC'
$_unixTimestamp
$_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)