homepage Welcome to WebmasterWorld Guest from 54.196.62.23
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
Set MySQL's timezone to GMT or do PHP & MySQL disagree on timezone?
JAB Creations

WebmasterWorld Senior Member jab_creations us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4189027 posted 6:18 am on Aug 19, 2010 (gmt 0)

I'm currently trying to have set my database to record everything as GMT time and then convert it to other time zones through PHP. The problem is that PHP and MySQL seem to disagree by an hour of time about what time it really is. In MySQL to get it to match I have to do the following...

date_default_timezone_set('Europe/London');
$query = "SET time_zone = '+1:00';"


Also wouldn't GMT be +0:00? Is London time not GMT? I'd really appreciate some clarification. :)

- John

 

whoisgregg

WebmasterWorld Senior Member whoisgregg us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4189027 posted 1:44 pm on Aug 20, 2010 (gmt 0)

British Summer Time starts the last Sunday in March and ends the last Sunday in October, at 1 am Greenwich Mean Time. The rest of the year they are on GMT.

Instead of using London time, just use GMT (from the manual [php.net]):

date_default_timezone_set('GMT');

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved