Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JDate

Description

JDate is a class that stores a date

Located in /joomla/utilities/date.php (line 43)

Class JObject   (Subpackage Base)

Class JDate   (Subpackage Utilities)
Variable Summary
Variable string $_date
Variable string $_offset
Method Summary
Constructor JDate __construct ([mixed $date = 'now'], [ $tzOffset = 0])
Method integer getOffset ()
Method void serverOffset ()
Method void setOffset (integer $offset)
Method a toFormat ([string $format = '%Y-%m-%d %H:%M:%S'])
Method a toISO8601 ()
Method a toMySQL ()
Method a toRFC822 ()
Method a toUnix ()
Variables
string $_date = 0 (line 51)

Unix timestamp

  • access: protected
string $_offset = 0 (line 59)

Timeoffset (in hours)

  • access: protected
Methods
Constructor __construct (line 69)

Creates a new instance of JDate representing a given date.

Accepts RFC 822, ISO 8601 date formats as well as unix time stamps. If not specified, the current date and time is used.

JDate __construct ([mixed $date = 'now'],  $tzOffset)
  • mixed $date: optional the date this JDate will represent.
  • $tzOffset

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
getOffset (line 144)

Get the date offset (in hours)

  • access: public
integer getOffset ()
serverOffset (line 217)
void serverOffset ()
setOffset (line 134)

Set the date offset (in hours)

  • access: public
void setOffset (integer $offset)
  • integer $offset: The offset in hours
toFormat (line 204)

Gets the date in a specific format

Returns a string formatted according to the given format. Month and weekday names and other language dependent strings respect the current locale

  • return: date in a specific format
a toFormat ([string $format = '%Y-%m-%d %H:%M:%S'])
toISO8601 (line 166)

Gets the date as an ISO 8601 date.

a toISO8601 ()
toMySQL (line 178)

Gets the date as in MySQL datetime format

a toMySQL ()
toRFC822 (line 154)

Gets the date as an RFC 822 date.

a toRFC822 ()
toUnix (line 189)

Gets the date as UNIX time stamp.

  • return: date as a unix time stamp
a toUnix ()

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getPublicProperties()
 JObject::set()
 JObject::toString()

Documentation generated on Mon, 05 Mar 2007 20:56:20 +0000 by phpDocumentor 1.3.1