开发者

date_default_timezone_set("Europe/London") does not return correct time

开发者 https://www.devze.com 2023-03-09 23:00 出处:网络
When I use following code to get current London time, it gives the wrong time. At the time of testing the current London time was 02:11:16 PM, Wednesday 01, June 2011, but I using the following code:

When I use following code to get current London time, it gives the wrong time.

At the time of testing the current London time was 02:11:16 PM, Wednesday 01, June 2011, but I using the following code:

date_default_timezone_set('Europe/London');
echo date('m/d/y h:i a',开发者_开发技巧 time());

Gave me: 06/02/11 02:12 am

Why did it not return correct London time?


date_default_timezone_set("Europe/London");

try with double quotes. works on godaddy


Check your ini file whether timezone is set or not,

ini_set('date.timezone', 'Europe/London');

Try this it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消