[Novalug] MySQL time does not match system time

Mike McFadden MMcFadden at agu.org
Wed Apr 7 14:26:28 EDT 2010


-----Original Message-----
From: jecottrell3 at comcast.net [mailto:jecottrell3 at comcast.net] 
Sent: Wednesday, April 07, 2010 1:55 PM
To: Peter Larsen
Cc: novalug at calypso.tux.org; Mike McFadden
Subject: Re: [Novalug] MySQL time does not match system time

And this is exactly why we have Universal Time. 

If UNIX taught us anything, it that it is an ERROR to store Local Time anywhere (well, except in the Greenwich Timezone for people who don't do Summer Time). MySQL should be giving back GMT and letting the applications do local conversion.

What would you do if you had a database that anyone in the world could connect to? You would use GMT!

So, if the "calculation" is being done by MySQL, that implies that it stores times in GMT. So Far So Good.

In the meantime, change the timezone from EST5EDT to EDT4 for a couple of weeks until DST kicks in.


System time or in MySQL? Thanks, Mike




JIM

P.S. in case you didn't know, Arizona, as well as various other places, doesn't have DST.

----- Original Message -----
From: "Peter Larsen" <plarsen at famlarsen.homelinux.com>
To: jecottrell3 at comcast.net
Cc: novalug at calypso.tux.org, "Mike McFadden" <MMcFadden at agu.org>
Sent: Tuesday, April 6, 2010 9:30:13 PM GMT -05:00 US/Canada Eastern
Subject: Re: [Novalug] MySQL time does not match system time

On Tue, 2010-04-06 at 22:27 +0000, jecottrell3 at comcast.net wrote:
> And this is a problem WHY? Internally, the time is correct. What difference does it make if dates are listed as

Because the offset calculation is not done on the HOST but on the DB.
This makes a lot of sense once you have bigger installations spanning
multiple hosts etc. or in particular when you need to serve data over
multiple timezones.

Bottom line for you is, that you need to ensure that your mySQL internal
information about daylight savings time is up to date. Just updating the
host's knowledge does NOT matter to the internals of mysql.

> Geeze...run your servers on GMT...or move to Arizona.

Doesn't solve your problem here. You still need to offset GMT/Zulu to
local time. And it's the offset definition metadata that's wrong
(mysql's version of it).

-- 
Best Regards
  Peter Larsen

Wise words of the day:
Hey, what do you expect from a culture that *drives* on *parkways* and
*parks* on *driveways*?
		-- Gallagher


More information about the Novalug mailing list