JDate: Difference between revisions
From Joomla! Documentation
Updated to r1448:247ba8d88526 |
m preparing for archive only |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
=={{JVer|11.1}} JDate== | =={{JVer|11.1}} JDate== | ||
===Description=== | ===Description=== | ||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
| Line 14: | Line 12: | ||
|- | |- | ||
|public | |public | ||
|[[JDate::__construct | |[[API17:JDate::__construct|__construct]] | ||
|Constructor. | |Constructor. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::__get | |[[API17:JDate::__get|__get]] | ||
|Magic method to access properties of the date given by class to the format method. | |Magic method to access properties of the date given by class to the format method. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::__toString | |[[API17:JDate::__toString|__toString]] | ||
|Magic method to render the date object in the format specified in the public static member JDate::$format. | |Magic method to render the date object in the format specified in the public static member JDate::$format. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::calendar | |[[API17:JDate::calendar|calendar]] | ||
|Gets the date as a formatted string in a local calendar. | |Gets the date as a formatted string in a local calendar. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::format | |[[API17:JDate::format|format]] | ||
|Gets the date as a formatted string. | |Gets the date as a formatted string. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::getOffsetFromGMT | |[[API17:JDate::getOffsetFromGMT|getOffsetFromGMT]] | ||
|Get the time offset from GMT in hours or seconds. | |Get the time offset from GMT in hours or seconds. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::setOffset | |[[API17:JDate::setOffset|setOffset]] | ||
|Set the date offset (in hours). | |Set the date offset (in hours). | ||
|- | |- | ||
|public | |public | ||
|[[JDate::setTimezone | |[[API17:JDate::setTimezone|setTimezone]] | ||
|Method to wrap the function and set the internal time zone object. | |Method to wrap the function and set the internal time zone object. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::toFormat | |[[API17:JDate::toFormat|toFormat]] | ||
|Gets the date in a specific format. | |Gets the date in a specific format. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::toISO8601 | |[[API17:JDate::toISO8601|toISO8601]] | ||
|Gets the date as an ISO 8601 string. | |Gets the date as an ISO 8601 string. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::toMySQL | |[[API17:JDate::toMySQL|toMySQL]] | ||
|Gets the date as an MySQL datetime string. | |Gets the date as an MySQL datetime string. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::toRFC822 | |[[API17:JDate::toRFC822|toRFC822]] | ||
|Gets the date as an RFC 822 string. | |Gets the date as an RFC 822 string. | ||
|- | |- | ||
|public | |public | ||
|[[JDate::toUnix | |[[API17:JDate::toUnix|toUnix]] | ||
|Gets the date as UNIX time stamp. | |Gets the date as UNIX time stamp. | ||
|- | |- | ||
|protected | |protected | ||
|[[JDate::dayToString | |[[API17:JDate::dayToString|dayToString]] | ||
|Translates day of week number to a string. | |Translates day of week number to a string. | ||
|- | |- | ||
|protected | |protected | ||
|[[JDate::monthToString | |[[API17:JDate::monthToString|monthToString]] | ||
|Translates month number to a string. | |Translates month number to a string. | ||
|- | |- | ||
| Line 79: | Line 77: | ||
===See also=== | ===See also=== | ||
* {{JVer|11.1}} '''JDate source code''' on [[jplatform:utilities/date.php|BitBucket]] | * {{JVer|11.1}} '''JDate source code''' on [[jplatform:utilities/date.php|BitBucket]] | ||
* {{JVer|11.1}} Subpackage [[Subpackage Utilities | * {{JVer|11.1}} Subpackage [[API17:Subpackage Utilities|Utilities]] | ||
* [[JDate|Other versions of JDate]] | * [[API17:JDate|Other versions of JDate]] | ||
===User contributed notes=== | ===User contributed notes=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=JDate | category=JDate | ||
namespace=CodeExample | |||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
| Line 96: | Line 92: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
<noinclude> | <noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude> | ||
Latest revision as of 02:50, 25 March 2017
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