JDate: Difference between revisions
From Joomla! Documentation
New page: <span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JDate}}
===Defined in===
libraries... |
m clean up |
||
| Line 1: | Line 1: | ||
{{subst:Description:JDate}} | |||
{{Description:JDate}} | |||
===Defined in=== | ===Defined in=== | ||
| Line 49: | Line 46: | ||
<source lang="php">jimport( 'joomla.utilities.date' );</source> | <source lang="php">jimport( 'joomla.utilities.date' );</source> | ||
{{subst:SeeAlso:JDate}} | |||
{{SeeAlso:JDate}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 13:50, 24 March 2017
{{subst:Description:JDate}}
Defined in
libraries/joomla/utilities/date.php
Methods
| 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
jimport( 'joomla.utilities.date' );
{{subst:SeeAlso:JDate}}
Examples
<CodeExamplesForm />