rorobobo Posted March 18, 2007 Share Posted March 18, 2007 How can I set the timezone so that the correct time appears on my site? The code I currently have is: echo date("F jS, Y, g:ia"); As far as I can tell the code above is taking the timezone from the server I am on which is MST. I want to set it to GMT which is 7 hours ahead of MST. Any help would be much appreciated. Cheers. Link to comment https://forums.phpfreaks.com/topic/43260-solved-set-timezone/ Share on other sites More sharing options...
ted_chou12 Posted March 18, 2007 Share Posted March 18, 2007 $time = strtotime("now"); $time = $time + 3600;//this is in intervals of 3600, either + or - according to your host's current time. $time = date("F jS, Y, g:ia", $time); echo $time; Ted Link to comment https://forums.phpfreaks.com/topic/43260-solved-set-timezone/#findComment-210029 Share on other sites More sharing options...
interpim Posted March 18, 2007 Share Posted March 18, 2007 $mytime=date()+25200; echo $mytime; Link to comment https://forums.phpfreaks.com/topic/43260-solved-set-timezone/#findComment-210030 Share on other sites More sharing options...
rorobobo Posted March 18, 2007 Author Share Posted March 18, 2007 Thank you so much guys. That worked a treat. Link to comment https://forums.phpfreaks.com/topic/43260-solved-set-timezone/#findComment-210047 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.