> -----Original Message-----
> From: Per Jessen [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 14, 2008 6:23 AM
> To: mysql@lists.mysql.com
> Subject: RE: what is the proper way to store timezone information?
> 
> Boyd, Todd M. wrote:
> 
> >>
> >> When recording this information, do I store the full name or just
> >> the 'time_zone_id' which is present in mysql.time_zone_name ?
> >
> > This is entirely a matter of choice. It's like asking if you should
> > store formatting when you insert phone numbers into a database--is it
> > easier for you to parse back if you do so? If yes, then store the
> > formatting. If no/probably not/I don't need to parse it, then just
> > store it without.
> 
> My concern is whether the time_zone_id is a fixed reference of the
> timezone.  If the id might (for whatever reason) change in the future,
> I'd have to store the timezone name.

http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html

You can convert back and forth using the system's time zone table. Read the 
MySQL manual I've linked to above for more information. Apparently, you can 
even reference them by offset from UTC (i.e., -6:00 for US Central). The 
article warns against using the time zone's text description, but I saw nothing 
about dangers of offsets or time_zone_id.


Todd Boyd
Web Programmer


Reply via email to