PHP timezone_open() 函數
實例
創建新的 DateTimeZone 對象,然后返回時區的名稱:
<?php $tz=timezone_open("Asia/Shanghai"); echo timezone_name_get($tz); ?>
定義和用法
timezone_open() 創建新的 DateTimeZone 對象。
技術細節
返回值: | 若成功則返回 DateTimeZone 對象,失敗則返回 FALSE。 |
---|---|
PHP 版本: | 5.2+ |
創建新的 DateTimeZone 對象,然后返回時區的名稱:
<?php $tz=timezone_open("Asia/Shanghai"); echo timezone_name_get($tz); ?>
timezone_open() 創建新的 DateTimeZone 對象。
返回值: | 若成功則返回 DateTimeZone 對象,失敗則返回 FALSE。 |
---|---|
PHP 版本: | 5.2+ |