Friday, March 05, 2010

MySQL timezone setting for IST

Normally on US based servers, default US timezone is used, when creating DateTime in mysql. If your application is served to only India based customers then better to set mysql timezone to show Indian time.

check time_zone* tables in mysql db. if they are empty fill them using following command

shell> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

Zone Info database on system.
Such systems are Linux, FreeBSD, Solaris, and Mac OS X. One likely location for these files is the /usr/share/zoneinfo directory.

mysql>SET GLOBAL time_zone = "Asia/Calcutta";


This blog is writter based on info from mysql website .
Post a Comment