That Damned Timezone Bug

My server is located on the east coast. I’m located on the west coast. So there’s that nasty problem that if the data ever moves across timezones, or I move, it gets all screwed up. So.. I’ve decided to store all the times in GMT (actually I decided that awhile ago). However it turns out that no matter what the format it is, when passed to MySQL’s UNIX_TIMESTAMP function, it uses the local time (the server’s).  That just isn’t going to cut it. So.. I’ve gone through and removed all of that. I now don’t do any time translations/calculations in MySQL. I just store and retrieve them in GMT.  All translations are done externally.  Oh well.. would have like to have used those handy YEAR() and MONTH() functions.


Bleah.. that timezone bug, that I thought I fixed should be really fixed now. Oh yeah.. that means all the previous times are screwed up probably. Oh well.

Leave a Reply