Spring saving time: watch your TIMESTAMPs

Every March we have a lot of bug reports and support issues about Daylight Saving Time changes.


General rule here is to remember 1 hour at March, 27 night will be missed in most of European countries: for example in Moscow after 01:59:59 next time will be 03:00:00. And yes, I am too late for America =)


MySQL handles such timestamps properly, therefore expect no such time and date will be inserted in STRICT mode and next valid date will be inserted for not existent time in forgiving mode. For Moscow '2011-03-27 03:00:00' will be inserted if you try to insert timestamps in '2011-03-27 02:00:01' - '2011-03-27 02:59:59' range.


You can see how Europe switch to DST at http://www.timeanddate.com/news/time/europe-starts-dst-2011.html Please note some countries such as Turkey have special rules for year 2011.


If you use timezones with special rules for this year make sure your operating system zoneinfo information is up to date, then reload MySQL time_zone\* tables using mysql_tzinfo_to_sql utility and finally restart MySQL server. You can read about mysql_tzinfo_to_sql at http://dev.mysql.com/doc/refman/5.5/en/mysql-tzinfo-to-sql.html



Have a nice spring!


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Working blog of Sveta Smirnova - MySQL Senior Principal Support Engineer working in Bugs Analysis Support Group

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today