{"id":84,"date":"2006-06-25T22:39:02","date_gmt":"2006-06-25T20:39:02","guid":{"rendered":"http:\/\/web.glandium.org\/blog\/?p=84"},"modified":"2010-01-27T08:52:39","modified_gmt":"2010-01-27T07:52:39","slug":"wordpress-and-daylight-saving","status":"publish","type":"post","link":"https:\/\/glandium.org\/blog\/?p=84","title":{"rendered":"WordPress and daylight saving"},"content":{"rendered":"<p>WordPress has a wonderful feature: instead of providing a timezone where you live, you tell it how much hours your local time differs from GMT. Which just fails when dealing with daylight saving.<\/p>\n<p>And I just noticed that my setting was still 1 hour, instead of 2. I remembered to change time on my wallclocks, mobile phone, but I forgot my blog... But changing that will change it only for future posts and comments.<\/p>\n<p>So, for people who forgot like me, here are two SQL queries to fix the database:<br \/>\n<code><br \/>\nupdate wp_posts set post_date = convert_tz(post_date_gmt, 'GMT', 'Europe\/Paris'), post_modified = convert_tz(post_modified_gmt, 'GMT', 'Europe\/Paris');<br \/>\nupdate wp_comments set comment_date = convert_tz(comment_date_gmt, 'GMT', 'Europe\/Paris');<br \/>\n<\/code><br \/>\nDon't forget to replace Europe\/Paris with whatever your timezone is ;) . Note that this will require you to run, if you've never done it before, something like<br \/>\n<code>mysql_tzinfo_to_sql \/usr\/share\/zoneinfo | mysql -p -u root mysql<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress has a wonderful feature: instead of providing a timezone where you live, you tell it how much hours your local time differs from GMT. Which just fails when dealing with daylight saving. And I just noticed that my setting was still 1 hour, instead of 2. I remembered to change time on my wallclocks, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[23],"class_list":["post-84","post","type-post","status-publish","format-standard","hentry","category-pdo","category-website","tag-en"],"_links":{"self":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=84"}],"version-history":[{"count":1,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":771,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/84\/revisions\/771"}],"wp:attachment":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}