PHP时区差异 - America / New_York = CDT?

时间:2009-10-30 17:21:29

标签: php timezone

这有什么意义?

date_default_timezone_set("America/New_York");
echo date("e"); //output "America/New_York"
echo date("T"); //output "CDT"

在某处我可以设置America / New_York = EDT吗?

1 个答案:

答案 0 :(得分:1)

尝试:

<?php
date_default_timezone_set('America/New_York');

$script_tz = date_default_timezone_get();

if (strcmp($script_tz, ini_get('date.timezone'))){
    echo 'Script timezone differs from ini-set timezone.';
} else {
    echo 'Script timezone and ini-set timezone match.';
}
?>