{"id":797,"date":"2018-10-21T04:31:50","date_gmt":"2018-10-21T04:31:50","guid":{"rendered":"http:\/\/hyderabadwebhosting.in\/blog\/?p=797"},"modified":"2018-10-30T04:34:11","modified_gmt":"2018-10-30T04:34:11","slug":"how-to-check-timezone-in-linux","status":"publish","type":"post","link":"https:\/\/hyderabadwebhosting.in\/blog\/how-to-check-timezone-in-linux\/","title":{"rendered":"How to Check Timezone in Linux"},"content":{"rendered":"<p><span style=\"font-size: large;\">How to Check Timezone in Linux<\/span><\/p>\n<p><span style=\"font-size: large;\">In this short article, we will walk newbies through the various simple ways of checking system timezone in Linux. Time management on a Linux machine especially a production server is always an important aspect of system administration.<\/span><\/p>\n<p><span style=\"font-size: large;\">There are a number of time management utilities available on Linux such as date and timedatectl commands to get the current timezone of system and synchronize with a remote NTP server to enable an automatic and more accurate system time handling.<\/span><\/p>\n<p><span style=\"font-size: large;\">Well, let us dive into the different ways of finding out our Linux system timezone.<\/span><\/p>\n<p><span style=\"font-size: large;\">1. We will start by using the traditional date command to find out present timezone as follows:<\/span><\/p>\n<pre class=\"lang:default decode:true\">date<\/pre>\n<p><span style=\"font-size: large;\">Alternatively, type the command below, where %Z format prints the alphabetic timezone and %z prints the numeric timezone:<\/span><\/p>\n<p><span style=\"font-size: large;\">Note: There are many formats in the date man page that you can make use of, to alter the output of the date command:<\/span><\/p>\n<pre class=\"lang:default decode:true\">man date<\/pre>\n<p><span style=\"font-size: large;\">2. Next, you can likewise use timedatectl, when you run it without any options, the command displays an overview of the system including the timezone like s<\/span><\/p>\n<pre class=\"lang:default decode:true\">timedatectl<\/pre>\n<p><span style=\"font-size: large;\">More so, try to employ a pipeline and grep command to only filter the timezone as below<\/span><\/p>\n<pre class=\"lang:default decode:true  \">timedatectl | grep \u201cTime zone\u201d<\/pre>\n<p><span style=\"font-size: large;\">3. For\u00a0<strong>REHL\/CentOS 7<\/strong>\u00a0and\u00a0<strong>Fedora 25-22<\/strong>\u00a0users, the file\u00a0<strong>\/etc\/localtime<\/strong>\u00a0is a symbolic link to the timezone file under the directory\u00a0<strong>\/usr\/share\/zoneinfo\/<\/strong>.<\/span><\/p>\n<p><span style=\"font-size: large;\">However, you can use date or timedatectl command to display the current time and timezone as well.<\/span><\/p>\n<p><span style=\"font-size: large;\">To change the timezone, create the symbolic link \/etc\/localtime to the appropriate timezone under \/usr\/share\/zoneinfo\/:<\/span><\/p>\n<pre class=\"lang:default decode:true\">sudo ln -sf \/usr\/share\/zoneinfo\/zoneinfo \/etc\/localtime<\/pre>\n<p><span style=\"font-size: large;\">The flag -s enables creation of a symbolic link, otherwise a hard link is created by default and -f removes an existing destination file, which in this case is \/etc\/localtime.<\/span><\/p>\n<p><span style=\"font-size: large;\">For example, to change the timezone to Africa\/Nairobi, issue the command below:<\/span><\/p>\n<pre class=\"lang:default decode:true\">sudo ln -sf \/usr\/share\/zoneinfo\/Africa\/Nairobi \/etc\/localtime<\/pre>\n<p><span style=\"font-size: large;\">That\u2019s all! Do not forget to share you thoughts about the article by means of the feedback form below. Importantly, you should look through this time management guide for Linux to get more insight into handling time on your system, it has simple and easy-to-follow examples.<\/span><\/p>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tfPqExJLUpMSkwpT03KyC8uycxL18vM00\/KyU8HAA==\" \/><input type=\"hidden\" name=\"blogName\" value=\"86hMSS1KTEpMUQhPTVLwyC8uycxLBwA=\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"M7c0BwA=\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"88gvVyjJV3DOSE3OVgjJzE2tys9LVcjMU\/DJzCutAAA=\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"BcFRDoAgCADQExH\/3UaUCcvAJU3t9L0nEX2ciLILP4lSmUziI9TqoYbUvKL4hHDIwvmC0Js\/NwY1aGrvwh8=\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"c\/QLDVAICHJ08XD0AwA=\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwtNA1NNA1MlQwMLEyNLAyNQAA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"tVbbauRGEH3PV1QM+zYX4hACk9mBZZNlFzZOSAwLeeuRSlIzrW7R3ZqxTB78G4EE9lv2U\/wlOdWSxhrHEM+GPBh5pO6qU+fUbd1s1qFRlkLsDL+8KJyN86BveUVG+ZK\/u9i8dQeKjl5XnO3oWtd86yyTtvRe2\/ZmvZTrm\/Wy2Xyx\/ndj7yzFSgcKlfORlI86MzyjA9NBG0MHZXZk+bDVHHDQu7as8GTaK69di3u6bgwOqy6QKygTUNqWFLoQuab4GN4iIaZaWVVyzTaSs6T6b3ibVRqHOTScaWVMh0+Nd3mbRY1zgf2ePQGuMskjQoN\/IFcwpORWFBSDc5XX2uoQvZLbizOZua7YMxjBH9m23sIxTMdH6NuojY7CjtorbdQWZLghVgptVgEW5SrCis3TbfmRRUOZq2EnD6JlyTGxmrXei9UjbZNgcD10NoMGFjghT4Rt8lw7GL+6\/nlkB+bYJhwIT7XR1Qg\/S\/drJ9Fk8CKAJhJRhc8Gup1L0gc2ZkYG8JELud6L0AAgseS6KDhFMyZHoW0uueFaqNT6kaTTTDkXwVcL+jAka4jIX9p2wCJuBAS0z7Wor0yvwsC6sCRwEpbGczhhHZIVzhh3CKtTNKAvMyqElxdG2XKVc6FaEynnzOW8ir7li424wXHPz4L\/ykT2Fgrt2XQzil3DfSYMOLcMGKjHlIwvfgMuDz0BGTyHdFKZplJbFo0fAsDNF7fTU8hg9pMjqzNpvkKWreihJgCuG8AEKe6kuBCMD9SgOvAGODvXUoY3tdoxZJGEngn3SsJOlyBA06aqPZoYYv8M7sX5efxfLuiKb+LsiNToHR906NFO6jVpYNMx36LtxFSBkj7ChGskycLsRLtch8YMbcqhNPeaD2OgQ9Zrm5k2P2brqJ+AoHB+\/BO8z6fgR+kKwQG771L3QEd3qfPqho0e0qn03Eyrx1l050IfdZwWT0rac9ETneCn33uX93d\/pokhtu\/v\/np+WF8v6I3znz6uMQCcLTe\/\/PD2\/fI16vynX+lbgOvffvqIeB4OveHceUWX38wvLydnkAt+EBch88P5JcdsaVyGfAbIyQ2ZURC53jqDqgOLOxr64pEosUStzQcCc+0Rt\/PdxHob\/DJUqLel3NC2cMujj3MbJdYGRhI+ZLokeKo3558aTIJ3yOB\/zKbjMBsVP2AOnD1gHdYFJAOf0DKjzLOg6qtkSuAp2SOfqsGGgE6X7oyQelqf4u8zukpoc0fG0jwUT5oc\/6HH2fDcVL2WvDKqhIdhdoeeBVl60DAeZdKMHAL3qUspjG6f9\/zo4RbnMgTHUESqeZEWhT2nXsQ3WIqk5+Qsz96NZKP0OI2VRQ9LYabgAc\/TuM7VGVUIl0r2xNT7nxBdXr8qMJ\/U8kpp77Z6Br+hfWIW\/g\/6nXr+DyqqeH\/3hyyn5kv63pF1UUZkWu4cJaep+GRslBXmptrK\/EhJ3C\/eolvNyoZxTBTM+VZhz5dR2xOwoHfjyisbgxjE8t4aJIFzu8mSDuEeb6tlq3MWW8PuNayeaS\/UNmig6he4cR\/sLbg09\/wwtGYy\/Cp13P1FGlahm0c379emUe5wkip\/Aw==\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\"><img src=\"https:\/\/hyderabadwebhosting.in\/blog\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/sheep_32x32.png\" alt=\"www.pdf24.org\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"<p>How to Check Timezone in Linux In this short article, we will walk newbies through the various simple ways of checking system timezone in Linux. Time management on a Linux machine especially a production server is always an important aspect of system administration. There are a number of time management utilities available on Linux such\u2026 <span class=\"read-more\"><a href=\"https:\/\/hyderabadwebhosting.in\/blog\/how-to-check-timezone-in-linux\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":796,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-797","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"_links":{"self":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=797"}],"version-history":[{"count":1,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/797\/revisions"}],"predecessor-version":[{"id":798,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/797\/revisions\/798"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/796"}],"wp:attachment":[{"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hyderabadwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}