怎麼去用PHP在Windows服務器上的服務器時區?PHP - 如何獲得Windows服務器時區?
對於Linux:
$systemTimeZone = system('date +%Z');
的* nix系統:
$systemTimeZone = popen("date +%Z");
窗口:
$systemTimeZone = ???
greez & THX, 天空...
編輯: 我知道像PHP函數:
date_default_timezone_get()
date('T')
\DateTime::timezone
,但所有來自PHP這個內置的功能是referenz在php.ini中設置。我想知道從操作系統中真正使用的時區。
我必須嘗試使用Windows命令行工具
systeminfo
但這是緩慢的通話和解析。另一種命令行工具,我有testet是:
tzutil /g
這不是時區格式我想要的東西,在我的情況下,我得到這樣的:
$:> tzutil /g
W. Europe Standard Time
任何其他的想法給我嗎?
TZ abbriviations在世界各地都是模棱兩可的。請參閱http://www.timeanddate.com/library/abbreviations/timezones/ –