◆ __construct()
__construct |
( |
|
$date = 'now' , |
|
|
|
$tz = null |
|
) |
| |
Constructor.
- Paramètres
-
string | $date | String in a format accepted by strtotime(), defaults to "now". |
mixed | $tz | Time zone to be used for the date. Might be a string or a DateTimeZone object. |
- Depuis
- 1.7.0
Références $date, Date\$tz, elseif, et null.
◆ __get()
Magic method to access properties of the date given by class to the format method.
- Paramètres
-
string | $name | The name of the property. |
- Renvoie
- mixed A value if the property name is valid, null otherwise.
- Depuis
- 1.7.0
Références $name, $value, Date\format(), et null.
◆ __toString()
Magic method to render the date object in the format specified in the public static member Date::$format.
- Renvoie
- string The date as a formatted string.
- Depuis
- 1.7.0
Références $format.
◆ calendar()
calendar |
( |
|
$format, |
|
|
|
$local = false , |
|
|
|
$translate = true |
|
) |
| |
Gets the date as a formatted string in a local calendar.
- Paramètres
-
string | $format | The date format specification string (see PHP_MANUAL#date) |
boolean | $local | True to return the date string in the local time zone, false to return it in GMT. |
boolean | $translate | True to translate localised strings |
- Renvoie
- string The date string in the specified format format.
- Depuis
- 1.7.0
Références Date\$format, et Date\format().
◆ dayToString()
dayToString |
( |
|
$day, |
|
|
|
$abbr = false |
|
) |
| |
Translates day of week number to a string.
- Paramètres
-
integer | $day | The numeric day of the week. |
boolean | $abbr | Return the abbreviated day string? |
- Renvoie
- string The day of the week.
- Depuis
- 1.7.0
Référencé par Date\format().
◆ format()
format |
( |
|
$format, |
|
|
|
$local = false , |
|
|
|
$translate = true |
|
) |
| |
◆ getInstance()
static getInstance |
( |
|
$date = 'now' , |
|
|
|
$tz = null |
|
) |
| |
|
static |
Proxy for new JDate().
- Paramètres
-
string | $date | String in a format accepted by strtotime(), defaults to "now". |
mixed | $tz | Time zone to be used for the date. |
- Renvoie
- Date
- Depuis
- 1.7.3
Références $date, et Date\$tz.
◆ getOffsetFromGmt()
getOffsetFromGmt |
( |
|
$hours = false | ) |
|
Get the time offset from GMT in hours or seconds.
- Paramètres
-
boolean | $hours | True to return the value in hours. |
- Renvoie
- float The time offset from GMT either in hours or in seconds.
- Depuis
- 1.7.0
◆ monthToString()
monthToString |
( |
|
$month, |
|
|
|
$abbr = false |
|
) |
| |
Translates month number to a string.
- Paramètres
-
integer | $month | The numeric month of the year. |
boolean | $abbr | If true, return the abbreviated month string |
- Renvoie
- string The month of the year.
- Depuis
- 1.7.0
Référencé par Date\format().
◆ setTimezone()
◆ toISO8601()
toISO8601 |
( |
|
$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.
- Paramètres
-
boolean | $local | True to return the date string in the local time zone, false to return it in GMT. |
- Renvoie
- string The date string in ISO 8601 format.
1.7.0
Références Date\format().
◆ toRFC822()
toRFC822 |
( |
|
$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.
- Paramètres
-
boolean | $local | True to return the date string in the local time zone, false to return it in GMT. |
- Renvoie
- string The date string in RFC 822 format.
1.7.0
Références Date\format().
◆ toSql()
Gets the date as an SQL datetime string.
- Paramètres
-
boolean | $local | True to return the date string in the local time zone, false to return it in GMT. |
\JDatabaseDriver | $db | The database driver or null to use ::getDbo() |
- Renvoie
- string The date string in SQL datetime format.
2.5.0
Références $db, Date\format(), et null.
◆ toUnix()
Gets the date as UNIX time stamp.
- Renvoie
- integer The date as a UNIX timestamp.
- Depuis
- 1.7.0
◆ $format
◆ $gmt
◆ $stz
◆ $tz
◆ DAY_ABBR
const DAY_ABBR = "\x021\x03" |
◆ DAY_NAME
const DAY_NAME = "\x022\x03" |
◆ MONTH_ABBR
const MONTH_ABBR = "\x023\x03" |
◆ MONTH_NAME
const MONTH_NAME = "\x024\x03" |
La documentation de cette classe a été générée à partir du fichier suivant :