API17:JDate
From Joomla! Documentation
JDate
Description
Methods
| Visibility | Method name | Description |
|---|---|---|
| public | __construct | Constructor. |
| public | __get | Magic method to access properties of the date given by class to the format method. |
| public | __toString | Magic method to render the date object in the format specified in the public static member JDate::$format. |
| public | calendar | Gets the date as a formatted string in a local calendar. |
| public | format | Gets the date as a formatted string. |
| public | getOffsetFromGMT | Get the time offset from GMT in hours or seconds. |
| public | setOffset | Set the date offset (in hours). |
| public | setTimezone | Method to wrap the function and set the internal time zone object. |
| public | toFormat | Gets the date in a specific format. |
| public | toISO8601 | Gets the date as an ISO 8601 string. |
| public | toMySQL | Gets the date as an MySQL datetime string. |
| public | toRFC822 | Gets the date as an RFC 822 string. |
| public | toUnix | Gets the date as UNIX time stamp. |
| protected | dayToString | Translates day of week number to a string. |
| protected | monthToString | Translates month number to a string. |
- Defined in libraries/joomla/utilities/date.php
Importing
jimport( 'joomla.utilities.date' );
See also
JDate source code on BitBucket
Subpackage Utilities- Other versions of JDate
User contributed notes
Code Examples