Why does this work?
date_default_timezone_set('Australia/Currie');
But this doesn't seem to take any effect at all?
date_default_timezone_set('UTC');
This value doesn't change when setting the timezone to UTC:
echo date('Y-m-d H:i:s', time());
I'm using php 5.2.13, and the timezone of my server is:
$server_tz = date_default_timezone_get();
echo $server_tz; //outputs 'America/Guayaquil'
This is the original code:
echo time() . "<br>
";
date_default_timezone_set('UTC');
echo time() . "<br>
";
Output:
1317235130
1317235130
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…