Joomla CMS  2.5.24 (avec JPlatform 11.4 inclus)
Documentation des API du CMS Joomla en version 2.5 et du framework Joomla Platform intégré
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JDate

Liste de tous les membres

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)
 setOffset ($offset)
 setTimezone ($tz)
 toFormat ($format= '%Y-%m-%d%H:%M:%S', $local=false)
 toISO8601 ($local=false)
 toMySQL ($local=false)
 toSql ($local=false, JDatabase $dbo=null)
 toRFC822 ($local=false)
 toUnix ()

Fonctions membres publiques statiques

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

Attributs publics

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
static $offsets

Documentation des constructeurs et destructeur

JDate::__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.
Depuis:
11.1
Exceptions:
JException

Références $date, elseif, et null.


Documentation des fonctions membres

JDate::__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:
11.1

Références $name, et null.

JDate::__toString ( )

Magic method to render the date object in the format specified in the public static member JDate::$format.

Renvoie:
string The date as a formatted string.
Depuis:
11.1
JDate::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:
11.1
JDate::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:
11.1

Références JText\_().

+ Voici le graphe d'appel pour cette fonction :

JDate::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:
11.1

Références $return.

static JDate::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:
JDate
Depuis:
11.3
Exceptions:
JException

Références $date.

JDate::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:
11.1
JDate::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:
11.1

Références JText\_().

+ Voici le graphe d'appel pour cette fonction :

JDate::setOffset (   $offset)

Set the date offset (in hours).

Paramètres:
float$offsetThe offset in hours.
Renvoie:
boolean True on success.
Depuis:
11.1
Obsolète:
12.1 Use setTimezone instead.

Références JLog\add(), et JLog\WARNING.

+ Voici le graphe d'appel pour cette fonction :

JDate::setTimezone (   $tz)

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

Paramètres:
object$tzThe new DateTimeZone object.
Renvoie:
DateTimeZone The old DateTimeZone object.
Depuis:
11.1
JDate::toFormat (   $format = '%Y-%m-%d %H:%M:%S',
  $local = false 
)

Gets the date in a specific format

Returns a string formatted according to the given format. Month and weekday names and other language dependent strings respect the current locale

Paramètres:
string$formatThe date format specification string (see PHP_MANUAL#strftime)
boolean$localTrue to return the date string in the local time zone, false to return it in GMT.
Renvoie:
string The date as a formatted string.
Obsolète:
Use JDate::format() instead.
Obsolète:
12.1 Use JDate::format() instead.

Références $date, JLog\add(), et JLog\WARNING.

+ Voici le graphe d'appel pour cette fonction :

JDate::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.

11.1

JDate::toMySQL (   $local = false)

Gets the date as an MySQL datetime string.

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 MySQL datetime format.

11.1 deprecated 291.

Références JLog\add(), et JLog\WARNING.

+ Voici le graphe d'appel pour cette fonction :

JDate::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.

11.1

JDate::toSql (   $local = false,
JDatabase  $dbo = 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.
JDatabase$dboThe database driver or null to use JFactory::getDbo()
Renvoie:
string The date string in SQL datetime format.

11.4

Références JFactory\getDbo(), et null.

+ Voici le graphe d'appel pour cette fonction :

JDate::toUnix ( )

Gets the date as UNIX time stamp.

Renvoie:
integer The date as a UNIX timestamp.
Depuis:
11.1

Documentation des données membres

JDate::$_tz
protected
JDate::$format = 'Y-m-d H:i:s'
static
JDate::$gmt
staticprotected
JDate::$offsets
staticprotected
Valeur initiale :
array('-12' => 'Etc/GMT-12', '-11' => 'Pacific/Midway', '-10' => 'Pacific/Honolulu', '-9.5' => 'Pacific/Marquesas',
'-9' => 'US/Alaska', '-8' => 'US/Pacific', '-7' => 'US/Mountain', '-6' => 'US/Central', '-5' => 'US/Eastern', '-4.5' => 'America/Caracas',
'-4' => 'America/Barbados', '-3.5' => 'Canada/Newfoundland', '-3' => 'America/Buenos_Aires', '-2' => 'Atlantic/South_Georgia',
'-1' => 'Atlantic/Azores', '0' => 'Europe/London', '1' => 'Europe/Amsterdam', '2' => 'Europe/Istanbul', '3' => 'Asia/Riyadh',
'3.5' => 'Asia/Tehran', '4' => 'Asia/Muscat', '4.5' => 'Asia/Kabul', '5' => 'Asia/Karachi', '5.5' => 'Asia/Calcutta',
'5.75' => 'Asia/Katmandu', '6' => 'Asia/Dhaka', '6.5' => 'Indian/Cocos', '7' => 'Asia/Bangkok', '8' => 'Australia/Perth',
'8.75' => 'Australia/West', '9' => 'Asia/Tokyo', '9.5' => 'Australia/Adelaide', '10' => 'Australia/Brisbane',
'10.5' => 'Australia/Lord_Howe', '11' => 'Pacific/Kosrae', '11.5' => 'Pacific/Norfolk', '12' => 'Pacific/Auckland',
'12.75' => 'Pacific/Chatham', '13' => 'Pacific/Tongatapu', '14' => 'Pacific/Kiritimati')
JDate::$stz
staticprotected
const JDate::DAY_ABBR = "\x021\x03"
const JDate::DAY_NAME = "\x022\x03"
const JDate::MONTH_ABBR = "\x023\x03"
const JDate::MONTH_NAME = "\x024\x03"

La documentation de cette classe a été générée à partir du fichier suivant :