Abstract Class Zend_Date_DateObject

Description
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /Date/DateObject.php (line 29)


	
			
Direct descendents
Class Description
 class Zend_Date
Variable Summary
 static mixed $_cache
 static mixed $_defaultOffset
 mixed $_dst
Method Summary
 static integer dayOfWeek (integer $year, integer $month, integer $day)
 static boolean isYearLeapYear (integer $year)
 mixed calcSun (array $location, bool $horizon, [ $rise = false])
 string date (string $format, [mixed $timestamp = null], [boolean $gmt = false])
 array getDateParts ([mixed $timestamp = null], [boolean $fast = null])
 integer getGmtOffset ()
 string getTimezone ()
 integer|string getUnixTimestamp ()
 integer|float mktime (integer $hour, integer $minute, integer $second, integer $month, integer $day, integer $year, [boolean $gmt = false])
 Zend_Date_DateObject setTimezone ([string $zone = null])
 string|integer setUnixTimestamp ([string|integer $timestamp = null])
 integer weekNumber (integer $year, integer $month, integer $day)
 integer _getTime ([integer $sync = null])
Variables
static mixed $_cache = null (line 35)
  • access: protected
static mixed $_defaultOffset = 0 (line 36)
  • access: protected
mixed $_dst = true (line 46)
  • access: protected
Methods
static dayOfWeek (line 620)

Returns the day of week for a Gregorian calendar date.

  1. = sunday, 6 = saturday

  • return: dayOfWeek
  • access: protected
static integer dayOfWeek (integer $year, integer $month, integer $day)
  • integer $year
  • integer $month
  • integer $day
static isYearLeapYear (line 269)

Returns true, if given $year is a leap year.

  • return: true, if year is leap year
  • access: protected
static boolean isYearLeapYear (integer $year)
  • integer $year
calcSun (line 893)

Calculates the sunrise or sunset based on a location

  • return: - false: midnight sun, integer:
  • access: protected
mixed calcSun (array $location, bool $horizon, [ $rise = false])
  • array $location: Location for calculation MUST include 'latitude', 'longitude', 'horizon'
  • bool $horizon: true: sunrise; false: sunset
  • $rise
date (line 296)

Internal mktime function used by Zend_Date for handling 64bit timestamps.

Returns a formatted date for a given timestamp.

  • access: protected
string date (string $format, [mixed $timestamp = null], [boolean $gmt = false])
  • string $format: format for output
  • mixed $timestamp
  • boolean $gmt: OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
getDateParts (line 658)

Internal getDateParts function for handling 64bit timestamps, similar to: http://www.php.net/getdate

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.

  • access: protected
array getDateParts ([mixed $timestamp = null], [boolean $fast = null])
  • mixed $timestamp
  • boolean $fast: OPTIONAL defaults to fast (false), resulting in fewer date parts
getGmtOffset (line 1043)

Return the offset to GMT of $this object's timezone.

The offset to GMT is initially set when the object is instantiated using the currently, in effect, default timezone for PHP functions.

  • return: seconds difference between GMT timezone and timezone when object was instantiated
  • access: public
integer getGmtOffset ()
getTimezone (line 1031)

Return the timezone of $this object.

The timezone is initially set when the object is instantiated.

  • return: actual set timezone string
  • access: public
string getTimezone ()
getUnixTimestamp (line 101)

Returns 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.

  • return: timestamp
  • access: protected
integer|string getUnixTimestamp ()
mktime (line 145)

Internal mktime function used by Zend_Date.

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 !!

  • return: timestamp (number of seconds elapsed relative to 1970/01/01 00:00:00 GMT/UTC)
  • access: protected
integer|float mktime (integer $hour, integer $minute, integer $second, integer $month, integer $day, integer $year, [boolean $gmt = false])
  • integer $hour
  • integer $minute
  • integer $second
  • integer $month
  • integer $day
  • integer $year
  • boolean $gmt: OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
setTimezone (line 994)

Sets a new timezone for calculation of $this object's gmt offset.

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.

  • return: Provides fluent interface
  • throws: Zend_Date_Exception
  • access: public
Zend_Date_DateObject setTimezone ([string $zone = null])
  • string $zone: OPTIONAL timezone for date calculation; defaults to date_default_timezone_get()
setUnixTimestamp (line 78)

Set this object to have a new UNIX timestamp.

  • return: old timestamp
  • throws: Zend_Date_Exception
  • access: protected
string|integer setUnixTimestamp ([string|integer $timestamp = null])
  • string|integer $timestamp: OPTIONAL timestamp; defaults to local time using time()
weekNumber (line 847)

Internal getWeekNumber function for handling 64bit timestamps

Returns the ISO 8601 week number of a given date

  • access: protected
integer weekNumber (integer $year, integer $month, integer $day)
  • integer $year
  • integer $month
  • integer $day
_getTime (line 118)

Internal function.

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.

  • return: timestamp
  • access: protected
integer _getTime ([integer $sync = null])
  • integer $sync: OPTIONAL time syncronisation value

Documentation generated on Mon, 21 Jun 2010 15:15:42 -0400 by phpDocumentor 1.4.3