API16

JDate

From Joomla! Documentation

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Defined in[edit]

libraries/joomla/utilities/date.php

Methods[edit]

Method name Description
__construct Constructor.
__toString Magic method to render the date object in the format specified in the public static member JDate::$format.
getOffsetFromGMT Get the time offset from GMT in hours or seconds.
format Gets the date as a formatted string.
toRFC822 Gets the date as an RFC 822 string. IETF RFC 2822 supercedes RFC 822 and its definition can be found at the IETF Web site.
toISO8601 Gets the date as an ISO 8601 string. IETF RFC 3339 defines the ISO 8601 format and it can be found at the IETF Web site.
toMySQL Gets the date as an MySQL datetime string.
toUnix Gets the date as UNIX time stamp.
setTimezone Method to wrap the setTimezone() function and set the internal time zone object.
setOffset Set the date offset (in hours).
toFormat Gets the date in a specific format

Importing[edit]

jimport( 'joomla.utilities.date' );



Examples[edit]

Code Examples[edit]