Moodle  2.2.1
http://www.collinsharper.com
Zend_Date_DateObject Class Reference
Inheritance diagram for Zend_Date_DateObject:

Public Member Functions

 setTimezone ($zone=null)
 getTimezone ()
 getGmtOffset ()

Protected Member Functions

 setUnixTimestamp ($timestamp=null)
 getUnixTimestamp ()
 _getTime ($sync=null)
 mktime ($hour, $minute, $second, $month, $day, $year, $gmt=false)
 date ($format, $timestamp=null, $gmt=false)
 getDateParts ($timestamp=null, $fast=null)
 weekNumber ($year, $month, $day)
 calcSun ($location, $horizon, $rise=false)

Static Protected Member Functions

static isYearLeapYear ($year)
static dayOfWeek ($year, $month, $day)

Protected Attributes

 $_dst = true

Static Protected Attributes

static $_cache = null
static $_defaultOffset = 0

Detailed Description

Definition at line 29 of file DateObject.php.


Member Function Documentation

_getTime ( sync = null) [protected]

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.

Parameters:
integer$syncOPTIONAL time syncronisation value
Returns:
integer timestamp

Definition at line 118 of file DateObject.php.

Here is the caller graph for this function:

calcSun ( location,
horizon,
rise = false 
) [protected]

Calculates the sunrise or sunset based on a location

Parameters:
array$locationLocation for calculation MUST include 'latitude', 'longitude', 'horizon'
bool$horizontrue: sunrise; false: sunset
Returns:
mixed - false: midnight sun, integer:

Definition at line 893 of file DateObject.php.

Here is the caller graph for this function:

date ( format,
timestamp = null,
gmt = false 
) [protected]

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

Returns a formatted date for a given timestamp.

Parameters:
string$formatformat for output
mixed$timestamp
boolean$gmtOPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
Returns:
string

Definition at line 296 of file DateObject.php.

Here is the caller graph for this function:

static dayOfWeek ( year,
month,
day 
) [static, protected]

Returns the day of week for a Gregorian calendar date. 0 = sunday, 6 = saturday

Parameters:
integer$year
integer$month
integer$day
Returns:
integer dayOfWeek

Definition at line 620 of file DateObject.php.

getDateParts ( timestamp = null,
fast = null 
) [protected]

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.

Parameters:
mixed$timestamp
boolean$fastOPTIONAL defaults to fast (false), resulting in fewer date parts
Returns:
array

Definition at line 658 of file DateObject.php.

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.

Returns:
integer seconds difference between GMT timezone and timezone when object was instantiated

Definition at line 1043 of file DateObject.php.

Here is the caller graph for this function:

Return the timezone of $this object. The timezone is initially set when the object is instantiated.

Returns:
string actual set timezone string

Definition at line 1031 of file DateObject.php.

Here is the caller graph for this function:

getUnixTimestamp ( ) [protected]

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.

Returns:
integer|string timestamp

Definition at line 101 of file DateObject.php.

Here is the caller graph for this function:

static isYearLeapYear ( year) [static, protected]

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

Parameters:
integer$year
Returns:
boolean true, if year is leap year

Definition at line 269 of file DateObject.php.

Here is the caller graph for this function:

mktime ( hour,
minute,
second,
month,
day,
year,
gmt = false 
) [protected]

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

Parameters:
integer$hour
integer$minute
integer$second
integer$month
integer$day
integer$year
boolean$gmtOPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
Returns:
integer|float timestamp (number of seconds elapsed relative to 1970/01/01 00:00:00 GMT/UTC)

Definition at line 145 of file DateObject.php.

Here is the caller graph for this function:

setTimezone ( zone = null)

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.

Parameters:
string$zoneOPTIONAL timezone for date calculation; defaults to date_default_timezone_get()
Returns:
Zend_Date_DateObject Provides fluent interface
Exceptions:
Zend_Date_Exception

Definition at line 994 of file DateObject.php.

Here is the caller graph for this function:

setUnixTimestamp ( timestamp = null) [protected]

Set this object to have a new UNIX timestamp.

Parameters:
string | integer$timestampOPTIONAL timestamp; defaults to local time using time()
Returns:
string|integer old timestamp
Exceptions:
Zend_Date_Exception

Definition at line 78 of file DateObject.php.

Here is the caller graph for this function:

weekNumber ( year,
month,
day 
) [protected]

Internal getWeekNumber function for handling 64bit timestamps

Returns the ISO 8601 week number of a given date

Parameters:
integer$year
integer$month
integer$day
Returns:
integer

Definition at line 847 of file DateObject.php.


Field Documentation

$_cache = null [static, protected]

Definition at line 35 of file DateObject.php.

$_defaultOffset = 0 [static, protected]

Definition at line 36 of file DateObject.php.

$_dst = true [protected]

Definition at line 46 of file DateObject.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations