开发者

PHP date() getting wrong time

i'm simply trying to get the current date in PHP, but it's getting '07:45:23' when it's really 11:02am (the date part of it is cor开发者_如何学JAVArect). i am setting the timezone like this:

date_default_timezone_set('America/New_York'); 
$now = date('Y-m-d H:i:s');

why isn't this working? i also tried 'EDT'. and if it matters, the server is also in the same timezone.

thanks.


Your server's time is likely incorrect. If you have SSH access, running date will show you what the server is set to.


Is the servers time set properly?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜