update : 2015.11.03
php.shukuma.com

검색:
 
 
Get the objectʼs timezone

IntlCalendar::getTimeZone

(PHP 5.5.0, PECL >= 3.0.0a1)

IntlCalendar::getTimeZoneGet the objectʼs timezone

설명

객체 기반 형식

public IntlTimeZone IntlCalendar::getTimeZone ( void )

절차식 형식

IntlTimeZone intlcal_get_time_zone ( IntlCalendar $cal )

Returns the IntlTimeZone object associated with this calendar.

인수

cal

The IntlCalendar resource.

반환값

An IntlTimeZone object corresponding to the one used internally in this object.

예제

Example #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());

위 예제의 출력:

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
)

참고