Support Joomla!

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JDate

Description

JDate is a class that stores a date

  • since: 1.5

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

Class JObject   (Subpackage Base)

Class JDate   (Subpackage Utilities)
Variable Summary
Variable int|boolean $_date
Variable string $_offset
Method Summary
Constructor JDate __construct ([mixed $date = 'now'], [int $tzOffset = 0])
Method integer getOffset ()
Method void setOffset (float $offset)
Method a toFormat ([string $format = '%Y-%m-%d %H:%M:%S'])
Method a toISO8601 ([ $local = false])
Method a toMySQL ([ $local = false])
Method a toRFC822 ([ $local = false])
Method a toUnix ([ $local = false])
Method string _dayToString (int $day, [bool $abbr = false])
Method string _monthToString (int $month, [bool $abbr = false])
Method string _strftime (string $format, int $time)
Variables
int|boolean $_date = false (line 33)

Unix timestamp

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

Time offset (in seconds)

  • access: protected

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 52)

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'], int $tzOffset)
  • mixed $date: optional the date this JDate will represent.
  • int $tzOffset: optional the timezone $date is from

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

Get the date offset (in hours)

  • access: public
integer getOffset ()
setOffset (line 145)

Set the date offset (in hours)

  • access: public
void setOffset (float $offset)
  • float $offset: The offset in hours
toFormat (line 225)

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 179)

Gets the date as an ISO 8601 date.

a toISO8601 ([ $local = false])
  • $local
toMySQL (line 195)

Gets the date as in MySQL datetime format

a toMySQL ([ $local = false])
  • $local
toRFC822 (line 166)

Gets the date as an RFC 822 date.

a toRFC822 ([ $local = false])
  • $local
toUnix (line 207)

Gets the date as UNIX time stamp.

  • return: date as a unix time stamp
a toUnix ([ $local = false])
  • $local
_dayToString (line 289)

Translates day of week number to string

  • return: day string
  • access: protected
string _dayToString (int $day, [bool $abbr = false])
  • int $day: The numeric day of the week
  • bool $abbr: Return the abreviated day string?
_monthToString (line 262)

Translates month number to string

  • return: month string
  • access: protected
string _monthToString (int $month, [bool $abbr = false])
  • int $month: The numeric month of the year
  • bool $abbr: Return the abreviated month string?
_strftime (line 240)

Translates needed strings in for JDate::toFormat (see http://www.php.net/strftime)

  • return: a date in the specified format
  • access: protected
string _strftime (string $format, int $time)

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()

Documentation generated on Sat, 14 Nov 2009 11:12:08 +0000 by phpDocumentor 1.3.1