Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Date
+ Graphe d'héritage de Date:

Fonctions membres publiques

 __construct ($date='now', $tz=null)
 
 __get ($name)
 
 __toString ()
 
 dayToString ($day, $abbr=false)
 
 calendar ($format, $local=false, $translate=true)
 
 format ($format, $local=false, $translate=true)
 
 getOffsetFromGmt ($hours=false)
 
 monthToString ($month, $abbr=false)
 
 setTimezone ($tz)
 
 toISO8601 ($local=false)
 
 toSql ($local=false, \JDatabaseDriver $db=null)
 
 toRFC822 ($local=false)
 
 toUnix ()
 

Fonctions membres publiques statiques

static getInstance ($date='now', $tz=null)
 

Champs de données

const DAY_ABBR = "\x021\x03"
 
const DAY_NAME = "\x022\x03"
 
const MONTH_ABBR = "\x023\x03"
 
const MONTH_NAME = "\x024\x03"
 

Attributs publics statiques

static $format = 'Y-m-d H:i:s'
 

Attributs protégés

 $tz
 

Attributs protégés statiques

static $gmt
 
static $stz
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $date = 'now',
  $tz = null 
)

Constructor.

Paramètres
string$dateString in a format accepted by strtotime(), defaults to "now".
mixed$tzTime 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.

Documentation des fonctions membres

◆ __get()

__get (   $name)

Magic method to access properties of the date given by class to the format method.

Paramètres
string$nameThe 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()

__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$formatThe date format specification string (see PHP_MANUAL#date)
boolean$localTrue to return the date string in the local time zone, false to return it in GMT.
boolean$translateTrue 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$dayThe numeric day of the week.
boolean$abbrReturn 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 
)

Gets the date as a formatted string.

Paramètres
string$formatThe date format specification string (see PHP_MANUAL#date)
boolean$localTrue to return the date string in the local time zone, false to return it in GMT.
boolean$translateTrue to translate localised strings
Renvoie
string The date string in the specified format format.
Depuis
1.7.0

Références Date\$format, $return, Date\dayToString(), et Date\monthToString().

Référencé par Date\__get(), Date\calendar(), Date\toISO8601(), Date\toRFC822(), et Date\toSql().

◆ getInstance()

static getInstance (   $date = 'now',
  $tz = null 
)
static

Proxy for new JDate().

Paramètres
string$dateString in a format accepted by strtotime(), defaults to "now".
mixed$tzTime 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$hoursTrue 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$monthThe numeric month of the year.
boolean$abbrIf true, return the abbreviated month string
Renvoie
string The month of the year.
Depuis
1.7.0

Référencé par Date\format().

◆ setTimezone()

setTimezone (   $tz)

Method to wrap the setTimezone() function and set the internal time zone object.

Paramètres
\DateTimeZone$tzThe new object.
Renvoie
Date
Depuis
1.7.0
Note
This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483

Références Date\$tz.

◆ 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$localTrue 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$localTrue 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()

toSql (   $local = false,
\JDatabaseDriver  $db = null 
)

Gets the date as an SQL datetime string.

Paramètres
boolean$localTrue to return the date string in the local time zone, false to return it in GMT.
\JDatabaseDriver$dbThe 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()

toUnix ( )

Gets the date as UNIX time stamp.

Renvoie
integer The date as a UNIX timestamp.
Depuis
1.7.0

Documentation des champs

◆ $format

$format = 'Y-m-d H:i:s'
static

Référencé par Date\calendar(), et Date\format().

◆ $gmt

$gmt
staticprotected

◆ $stz

$stz
staticprotected

◆ $tz

$tz
protected

◆ 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 :