Page 1 of 1

how to store timezone in a table

Posted: Tue Aug 17, 2004 3:08 am
by jasongr
Hello

I have a table which stores an attribute of type DATETIME. I would also like to know what timezone this type represents. Does the DATETIME type implicitly stores the timezone of a value or do I need to store it separately in a separate attribute? If so, what type should the timezone be stored at?

CREATE TABLE time_info (
time DATETIME NOT NULL,
timezone <type ?>
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

regards
Jason

Posted: Tue Aug 17, 2004 6:51 am
by litebearer
Generally, the datetime, timestamps etc are based upon the date/time of the server. You could use GMT time to determine what zone a server is in. ie GMT - 5 is EST. Perhaps using that info you can decide what values you want to store.

Lite...

Posted: Tue Aug 17, 2004 6:58 am
by jasongr
thanks I will keep that in mind