doujing8435 2017-04-25 05:17
浏览 69

php中的默认时区

I am trying to save the current date and time and i have used the following code

Current PHP version: 5.4.16

 date_default_timezone_set('Asia/Kolkata'); 
 $datet = date("Y-m-d H:i:s ");

When i echo it the output will be

2017-04-25 05:07:17

But actual time what i need is

2017-04-25 10:45:17

I have tried using now() but its also showing the same date rather than the current time, In what ways i can get the Current date and time. Any help appreciated.

  • 写回答

3条回答 默认 最新

  • duanbiao4035 2017-04-25 05:24
    关注

    have you tried to change the server time, print date on console, if this mismatched, then change the server time.

    评论

报告相同问题?