Class JDate
JDate is a class that stores a date and provides logic to manipulate and render that date in a variety of formats.
- DateTime implements DateTimeInterface
- JDate
Copyright: Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
License: General Public License version 2 or later; see LICENSE
Since: 11.1
Located at joomla/date/date.php
Methods summary
public
|
|
public
mixed
|
|
public
string
|
#
__toString( )
Magic method to render the date object in the format specified in the public static member JDate::$format. |
public static
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
float
|
|
public
string
|
|
public
|
#
setTimezone(
Method to wrap the setTimezone() function and set the internal time zone object. |
public
string
|
|
public
string
|
#
toSql( boolean $local = false,
Gets the date as an SQL datetime string. |
public
string
|
|
public
integer
|
Methods inherited from DateTime
__set_state()
,
__wakeup()
,
add()
,
createFromFormat()
,
diff()
,
getLastErrors()
,
getOffset()
,
getTimestamp()
,
getTimezone()
,
modify()
,
setDate()
,
setISODate()
,
setTime()
,
setTimestamp()
,
sub()
Magic methods summary
public
|
|
public
|
|
public
|
Constants summary
string |
DAY_ABBR
|
"\x021\x03" |
|
string |
DAY_NAME
|
"\x022\x03" |
|
string |
MONTH_ABBR
|
"\x023\x03" |
|
string |
MONTH_NAME
|
"\x024\x03" |
Constants inherited from DateTime
ATOM
,
COOKIE
,
ISO8601
,
RFC1036
,
RFC1123
,
RFC2822
,
RFC3339
,
RFC3339_EXTENDED
,
RFC822
,
RFC850
,
RSS
,
W3C
Properties summary
public static
string
|
$format |
#
The format string to be applied when using the __toString() magic method. |
protected static
object
|
$gmt |
#
Placeholder for a DateTimeZone object with GMT as the time zone. |
protected static
object
|
$stz |
#
Placeholder for a DateTimeZone object with the default server time zone as the time zone. |
protected
|
$tz |
#
The DateTimeZone object for usage in rending dates as strings. |
Magic properties
public read-only
string
|
$daysinmonth |
|
#
t - Number of days in the given month. |
public read-only
string
|
$dayofweek |
|
#
N - ISO-8601 numeric representation of the day of the week. |
public read-only
string
|
$dayofyear |
|
#
z - The day of the year (starting from 0). |
public read-only
boolean
|
$isleapyear |
|
#
L - Whether it's a leap year. |
public read-only
string
|
$day |
|
#
d - Day of the month, 2 digits with leading zeros. |
public read-only
string
|
$hour |
|
#
H - 24-hour format of an hour with leading zeros. |
public read-only
string
|
$minute |
|
#
i - Minutes with leading zeros. |
public read-only
string
|
$second |
|
#
s - Seconds with leading zeros. |
public read-only
string
|
$microsecond |
|
#
u - Microseconds with leading zeros. |
public read-only
string
|
$month |
|
#
m - Numeric representation of a month, with leading zeros. |
public read-only
string
|
$ordinal |
|
#
S - English ordinal suffix for the day of the month, 2 characters. |
public read-only
string
|
$week |
|
#
W - ISO-8601 week number of year, weeks starting on Monday. |
public read-only
string
|
$year |
|
#
Y - A full numeric representation of a year, 4 digits. |