Thanks for the link Philip. I downloaded and updated all my /usr/share/zoneinfo then imported them into MySQL using their mysql_tzinfo_to_sql tool.

Is there a better way to store the time zone of our customers other than VARCHAR? I noticed that the utility above created an INT indexed table of tzID <-> tzName but those tables are in the mysql database and I'd rather not give users permission to that table. Plus that would complicate SQL queries further by adding in either A) another JOIN statement or B) an extra SELECT to convert the INT to a name.

Any thoughts?

Thanks,
Matthew

Garrett, Philip (MAN-Corporate) wrote:
Matthew wrote:
Ahh. And we have customers all over the world. Dang. See, all of this
programming was done back shortly after we "sprang forward" so we
didn't think about it.

Any suggestions on how I should store a customers timezone in
database?

I think the best way is probably using the Olson time zone name.  These
are names like 'America/New_York' and 'Australia/Melbourne'.
http://www.twinsun.com/tz/tz-link.htm

Perl's DateTime module uses these time zones, as do MySQL >= 4.1.3 and
Oracle >= 9i.

Regards,
Philip

Reply via email to