{"id":2495,"date":"2013-10-14T08:45:33","date_gmt":"2013-10-14T00:45:33","guid":{"rendered":"http:\/\/rmohan.com\/?p=2495"},"modified":"2013-10-14T08:45:33","modified_gmt":"2013-10-14T00:45:33","slug":"how-to-change-time-zone-in-linux","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2495","title":{"rendered":"How to change Time zone in Linux"},"content":{"rendered":"<p># cd \/etc<br \/>\n# rm localtime \u00a0\/\/delete the existing localtime file<\/p>\n<p>Check the available time zones in US<\/p>\n<p># ls \/usr\/share\/zoneinfo\/US\/<br \/>\nAlaska \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Arizona \u00a0 \u00a0 \u00a0 \u00a0 Eastern \u00a0 \u00a0 \u00a0 \u00a0 Hawaii \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Michigan \u00a0 \u00a0 \u00a0 \u00a0Pacific<br \/>\nAleutian \u00a0 \u00a0 \u00a0 \u00a0Central \u00a0 \u00a0 \u00a0 \u00a0 East-Indiana \u00a0 \u00a0Indiana-Starke \u00a0Mountain \u00a0 \u00a0 \u00a0 \u00a0Samoa<\/p>\n<p>Note: For other country timezones, browse the \/usr\/share\/zoneinfo directory<\/p>\n<p>Now we can change the time zone using below step<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p># vi \/etc\/timezone<br \/>\nAmerica\/Los_Angeles<\/p>\n<p>then export the TZ variable<\/p>\n<p>$ export TZ=America\/Los_Angeles<br \/>\n$ date<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\nUsing below interactive method also we can change the Time zone<\/p>\n<p>Ubuntu: dpkg-reconfigure tzdata<br \/>\nRedhat: redhat-config-date<br \/>\nCentOS\/Fedora: system-config-date<br \/>\nFreeBSD\/Slackware: tzselect<\/p>\n<p><b># ln -sf \/usr\/share\/zoneinfo\/Asia\/Calcutta localtime<\/b><\/p>\n<p>Now check the time<\/p>\n<p>#date<\/p>\n<p># date<br \/>\nMon Aug 17 23:10:14 IST 2013<\/p>\n<p>But if you are doing any patching then after patching this Time zone will get changed. So this method is not perfect one.<\/p>\n","protected":false},"excerpt":{"rendered":"<p># cd \/etc # rm localtime \/\/delete the existing localtime file<\/p>\n<p>Check the available time zones in US<\/p>\n<p># ls \/usr\/share\/zoneinfo\/US\/ Alaska Arizona Eastern Hawaii Michigan Pacific Aleutian Central East-Indiana Indiana-Starke Mountain Samoa<\/p>\n<p>Note: For other country timezones, browse the \/usr\/share\/zoneinfo directory<\/p>\n<p>Now we can change the time zone using below step<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p># [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2495"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2495"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2495\/revisions"}],"predecessor-version":[{"id":2496,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2495\/revisions\/2496"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}