RE: RE: what is the proper way to store timezone information?

2008-06-17 Thread Per Jessen
Boyd, Todd M. wrote:

 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.

I am using just that, and I have also read the manual on the subject,
but nonetheless I have to store the time-zone identifier somewhere and
in some form.

 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.

Yeah, in fact that article doesn't even mention the time_zone_id, which
is why I'm hesitant using it as a definite reference to a time zone. 
I'd prefer not to use offset, as I would loose the little bit of
geographical info then. ('Europe/Zurich' has the same offset
as 'Europe/Copenhagen').  For now I'm storing the name of the timezone,
but the manual is clearly lacking some info in this respect. 


/Per Jessen, Zürich


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: RE: what is the proper way to store timezone information?

2008-06-16 Thread Boyd, Todd M.
 -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