DateTime
class DateTime extends DateTime (View source)
The DateTime class.
Constants
FORMAT_YMD |
|
FORMAT_YMD_HI |
|
FORMAT_YMD_HIS |
|
TZ_LOCALE |
|
Properties
static string | $format | The format string to be applied when using the __toString() magic method. |
Methods
Constructor.
setDefaultGMT
resetDefaultTimezone
Convert a date string to another timezone.
utcToLocal
localToUTC
Method to set property useServerDefaultTimezone
Magic method to access properties of the date given by class to the format method.
Magic method to render the date object in the format specified in the public static member JDate::$format.
Gets the date as a formatted string.
Get the time offset from GMT in hours or seconds.
Method to wrap the setTimezone() function and set the internal time zone object.
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.
Gets the date as an SQL datetime string.
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.
Gets the date as UNIX time stamp.
getSqlFormat
Details
at line line 73
__construct(string $date = 'now', mixed $tz = null)
Constructor.
at line line 115
static void
setDefaultTimezone($tz = 'UTC')
setDefaultGMT
at line line 127
static void
resetDefaultTimezone()
resetDefaultTimezone
at line line 159
static string
convert(string $date, string $from = 'UTC', string $to = 'UTC', string $format = null)
Convert a date string to another timezone.
at line line 181
static string
toLocalTime(string $date, string $format = null, string $to = null)
utcToLocal
at line line 199
static string
toServerTime(string $date, string $format = null, string $from = null)
localToUTC
at line line 215
static boolean
useServerDefaultTimezone(boolean $boolean = null)
Method to set property useServerDefaultTimezone
at line line 236
mixed
__get(string $name)
Magic method to access properties of the date given by class to the format method.
at line line 290
string
__toString()
Magic method to render the date object in the format specified in the public static member JDate::$format.
at line line 305
static DateTime
create(string $date = 'now', mixed $tz = null)
Proxy for new DateTime.
at line line 320
string
format(string $format, boolean $local = false)
Gets the date as a formatted string.
at line line 348
float
getOffsetFromGmt(boolean $hours = false)
Get the time offset from GMT in hours or seconds.
at line line 362
DateTime
setTimezone(DateTimeZone|string $tz)
Method to wrap the setTimezone() function and set the internal time zone object.
at line line 385
string
toISO8601(boolean $local = false)
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.
at line line 401
string
toSql(boolean $local = false, AbstractDatabaseDriver $db = null)
Gets the date as an SQL datetime string.
at line line 417
string
toRFC822(boolean $local = false)
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.
at line line 429
integer
toUnix()
Gets the date as UNIX time stamp.
at line line 441
static string
getSqlFormat(AbstractDatabaseDriver $db = null)
getSqlFormat