{"id":309,"date":"2013-01-22T22:23:59","date_gmt":"2013-01-22T22:23:59","guid":{"rendered":"http:\/\/vickistan.com\/?p=309"},"modified":"2013-01-22T22:23:59","modified_gmt":"2013-01-22T22:23:59","slug":"timezones-in-mysql","status":"publish","type":"post","link":"https:\/\/vickistan.com\/?p=309","title":{"rendered":"Timezones in MySQL"},"content":{"rendered":"<p>Timezone<br \/>\n[root@server02 ~]# date \u2028Fri Feb 24 02:11:38 CST 2012<br \/>\nMySQL time-zone:<br \/>\nmysql> show global variables like &#8216;%time_zone%&#8217;;<br \/>\n\u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+<br \/>\n\u2028| Variable_name | Value |<br \/>\n\u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+ \u2028<br \/>\n| system_time_zone | CST |<br \/>\n\u2028| time_zone | SYSTEM |<br \/>\n\u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+<br \/>\n\u20282 rows in set (0.00 sec)<\/p>\n<p>mysql> show variables like &#8216;%time_zone%&#8217;;<br \/>\n\u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+<br \/>\n\u2028| Variable_name | Value |<br \/>\n\u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+<br \/>\n\u2028| system_time_zone | CST |<br \/>\n\u2028| time_zone | SYSTEM |<br \/>\n\u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+<br \/>\n\u20282 rows in set (0.00 sec)<\/p>\n<p>The MySQL timezone is inherited from the server&#8217;s timezone.<\/p>\n<p>PHP timezone is CST (also inherited from the server timezone).<\/p>\n<p>[root@server02 ~]# php 2>\/dev\/null <\/p>\n<p>\u2028< ?php \n\u2028echo date_default_timezone_get(); \n\u2028?><br \/>\n\u2028America\/Chicago<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Timezone [root@server02 ~]# date \u2028Fri Feb 24 02:11:38 CST 2012 MySQL time-zone: mysql> show global variables like &#8216;%time_zone%&#8217;; \u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+ \u2028| Variable_name | Value | \u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+ \u2028 | system_time_zone | CST | \u2028| time_zone | SYSTEM | \u2028+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;+ \u20282 rows in &hellip; <a href=\"https:\/\/vickistan.com\/?p=309\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-309","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309"}],"version-history":[{"count":2,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}