IntlCalendar::getTimeZone
(PHP 5.5.0, PECL >= 3.0.0a1)
IntlCalendar::getTimeZone — Get the objectʼs timezone
Description
Returns the IntlTimeZone object associated with this calendar.
Liste de paramètres
Cette fonction ne contient aucun paramètre.
Valeurs de retour
An IntlTimeZone object corresponding to the one used internally in this object.
Exemples
Exemple #1 IntlCalendar::getTimeZone()
<?php ini_set('date.timezone', 'Europe/Lisbon'); ini_set('intl.default_locale', 'en_US'); $cal = IntlCalendar::createInstance(); print_r($cal->getTimeZone()); $cal->setTimeZone('UTC'); print_r($cal->getTimeZone()); $cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00 GMT+03:33'); print_r($cal->getTimeZone());
L'exemple ci-dessus va afficher :
IntlTimeZone Object ( [valid] => 1 [id] => Europe/Lisbon [rawOffset] => 0 [currentOffset] => 3600000 ) IntlTimeZone Object ( [valid] => 1 [id] => UTC [rawOffset] => 0 [currentOffset] => 0 ) IntlTimeZone Object ( [valid] => 1 [id] => GMT+03:33 [rawOffset] => 12780000 [currentOffset] => 12780000 )
Voir aussi
- IntlCalendar::setTimeZone() - Set the timezone used by this calendar
- IntlCalendar::createInstance() - Crée un nouvel objet IntlCalendar
- IntlGregorianCalendar::__construct()