2024 年日本 PHP 研討會

IntlTimeZone::createTimeZoneIDEnumeration

intltz_create_time_zone_id_enumeration

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

IntlTimeZone::createTimeZoneIDEnumeration -- intltz_create_time_zone_id_enumeration使用指定的篩選條件取得系統時區 ID 的列舉

說明

物件導向風格 (方法)

公開 靜態 IntlTimeZone::createTimeZoneIDEnumeration(整數 $type, ?字串 $region = null, ?整數 $rawOffset = null): IntlIterator|false

程序式風格

intltz_create_time_zone_id_enumeration(整數 $type, ?字串 $region = null, ?整數 $rawOffset = null): IntlIterator|false

警告

此函數目前沒有說明文件;僅提供其參數列表。

參數

type

region

rawOffset

回傳值

成功時返回 IntlIterator,失敗時返回 false

新增筆記

使用者提供的筆記 1 則筆記

mattkyn at gmail dot com
2 年前
迭代回傳值會提供一個包含時區 ID 的字串(例如「Europe/London」或「Etc/GMT-1」)

關於 `zoneType` 參數要使用的常數,請參閱
https://github.com/php/php-src/blob/master/ext/intl/timezone/timezone_class.cpp#L419-L421

<?php
IntlTimeZone
::TYPE_ANY // 全部,包含別名,例如「CST」
IntlTimeZone::TYPE_CANONICAL // 標準 ID(無別名)
IntlTimeZone::TYPE_CANONICAL_LOCATION // 僅限位置的 ID(無「Etc/GMT-1」)
?>
To Top