array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'intlcalendar.gettimezone.php', 1 => 'IntlCalendar::getTimeZone', 2 => 'Get the objectʼs timezone', ), 'up' => array ( 0 => 'class.intlcalendar.php', 1 => 'IntlCalendar', ), 'prev' => array ( 0 => 'intlcalendar.gettime.php', 1 => 'IntlCalendar::getTime', ), 'next' => array ( 0 => 'intlcalendar.gettype.php', 1 => 'IntlCalendar::getType', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/intl/intlcalendar/gettimezone.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)
IntlCalendar::getTimeZone — Get the objectʼs timezone
Objektorientierter Stil
Prozeduraler Stil
Returns the IntlTimeZone object associated with this calendar.
calendar
Eine IntlCalendar-Instanz.
An IntlTimeZone object corresponding to the one used
internally in this object. Returns false
on failure.
Beispiel #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());
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
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 )