Sunday, April 8, 2012

Re: populate time zone table

Wanted to use the convert_tz functionality of mysql to convert the datetime to a standard timezone before saving it in the database.

This can definitely be done at the app level in java / python. However, they also rely on the machine timezone info no?


On Thu, Apr 5, 2012 at 3:34 PM, Ken Ashcraft <kash@google.com> wrote:
On Thu, Apr 5, 2012 at 7:39 AM, rka <rkagrawal@gmail.com> wrote:
Hello,
  By default the mysql database does not have the time zone information populated.

Can you explain what problem you are trying to solve with the time zone info?  Is this something that could be solved at the application level?
 
  You have to populate it manually by running  mysql_tzinfo_to_sql on the machine mysql is installed.

  For mysql on google cloud, how do I do that? Is there a way to access the box ?


No, you can't access the machine running your mysql instance.

Timezones are tricky, and the machine's timezone is probably not the one that you want.  In general, it seems better to store things in UTC and present them to the user in the user's timezone.  Both Java and Python have facilities for that.

Ken

No comments:

Post a Comment