Skip navigation links

MySQL Forums :: General :: Storing timezone with datetime


Advanced Search

Storing timezone with datetime
Posted by: Robert Dodier ()
Date: June 26, 2009 12:38PM

Hello,

I have some datetime fields. I would like to store the timezone with the datetime. Yes, it's possible to set a session-wide or system-wide timezone; I don't want to do that. I want to make it possible for different records to have different timezones, and I want to make the datetime fields independent of the session-wide or system-wide timezone.

I see 2 ways to store the timezone.

(1) create an additional field which stores just the timezone (as an offset or timezone name)

(2) store a string which specifies timezone e.g. ISO 8601 style '2009-06-26 12:33:00-0600'

I'd rather just store the timezone in the datetime field, but I don't see a way to do it. Do I understand correctly that the timezone cannot be stored in a datetime field? I hope I'm mistaken. If indeed it is possible, please explain how to do it.

Sorry if this is a FAQ, I couldn't find an answer to this specific question.

Thanks very much for any light you can shed on this problem.

Robert Dodier

Options: ReplyQuote


Subject Written By Posted
Storing timezone with datetime Robert Dodier 06/26/2009 12:38PM
Re: Storing timezone with datetime Peter Brawley 06/26/2009 04:26PM
Re: Storing timezone with datetime Robert Dodier 06/26/2009 05:50PM
Re: Storing timezone with datetime Peter Brawley 06/26/2009 07:14PM
Re: Storing timezone with datetime Rick James 06/27/2009 12:55AM
Re: Storing timezone with datetime Robert Dodier 06/29/2009 10:36AM
Re: Storing timezone with datetime Rick James 06/30/2009 12:15AM
Re: Storing timezone with datetime James Birchall 07/23/2009 11:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.