php_nub_qq Posted May 2, 2013 Share Posted May 2, 2013 Hello. I am having this issue where my server clock is wrong and I just can;t fix it. My timezone is GMT+2 and it is currently 14:05 ( Or 2 pm ). Right so I set my timezone to GMT date_default_timezone_set('GMT'); and it gives me this 2013-05-02 11:05:17 I assume this could be due to the daylight saving time but what can I do, I can't just go around adding and subtracting hours. Any help? Link to comment https://forums.phpfreaks.com/topic/277537-server-clock-is-wrong/ Share on other sites More sharing options...
Phear46 Posted May 2, 2013 Share Posted May 2, 2013 have you checked around on the net to see what gmt currently is? i suspect your problem is daylight savings as you say. you might just have to write bit of code to enable/disable daylight savings? Link to comment https://forums.phpfreaks.com/topic/277537-server-clock-is-wrong/#findComment-1427725 Share on other sites More sharing options...
DaveyK Posted May 2, 2013 Share Posted May 2, 2013 I am just guessing, but what does this do: date_default_timezone_set('Europe/London'); Also, on http://wwp.greenwichmeantime.com/info/current-time/ I found that the UK is on GMT in the winter but on BST in the summer. Link to comment https://forums.phpfreaks.com/topic/277537-server-clock-is-wrong/#findComment-1427728 Share on other sites More sharing options...
php_nub_qq Posted May 2, 2013 Author Share Posted May 2, 2013 oh snap... Apparently my timezone is now GMT+3 ... This explains a lot. And is going to be an easy fix to my problem because I get the user's timezone and convert it into GMT + X. Now after the timezone has changed to +3 ( in my case ) this is no longer a problem. Thank you ! Link to comment https://forums.phpfreaks.com/topic/277537-server-clock-is-wrong/#findComment-1427729 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.