Internationalization IntlDateFormatter::getTimeZoneId

IntlDateFormatter::getTimeZoneId

datefmt_get_timezone_id

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

IntlDateFormatter::getTimeZoneId -- datefmt_get_timezone_id — IntlDateFormatter에 사용되는 시간대 ID를 가져옵니다.


설명

객체 지향 스타일

public IntlDateFormatter::getTimeZoneId(): string|false

절차 스타일:

datefmt_get_timezone_id(IntlDateFormatter $formatter): string|false

IntlDateFormatter에 사용되는 시간대 ID를 가져옵니다.


매개변수

formatter
포맷터 리소스

반환 값

이 포맷터가 사용하는 시간대의 ID 문자열이거나 실패 시 false입니다.


Examples

예제 #1 datefmt_get_timezone_id() 예제

                  
<?php
$fmt = datefmt_create(
    'en_US',
    IntlDateFormatter::FULL,
    IntlDateFormatter::FULL,
    'America/Los_Angeles',
    IntlDateFormatter::GREGORIAN
);
echo 'timezone_id of the formatter is: ' . datefmt_get_timezone_id($fmt) . "\n";
datefmt_set_timezone($fmt, 'Europe/Madrid');
echo 'Now timezone_id of the formatter is: ' . datefmt_get_timezone_id($fmt);

?>
                  
                

예제 #2 OO 예제

                  
<?php
$fmt = new IntlDateFormatter(
    'en_US',
    IntlDateFormatter::FULL,
    IntlDateFormatter::FULL,
    'America/Los_Angeles',
    IntlDateFormatter::GREGORIAN
);
echo 'timezone_id of the formatter is: ' . $fmt->getTimezoneId() . "\n";
$fmt->setTimezone('Europe/Madrid');
echo 'Now timezone_id of the formatter is: ' . $fmt->getTimezoneId();

?>
                  
                

위의 예는 다음을 출력합니다.

timezone_id of the formatter is: America/Los_Angeles
Now timezone_id of the formatter is: Europe/Madrid
                

기타