{"id":29,"date":"2019-10-28T10:39:30","date_gmt":"2019-10-28T10:39:30","guid":{"rendered":"https:\/\/webhostingnoida.in\/blog\/?p=29"},"modified":"2019-11-11T02:23:32","modified_gmt":"2019-11-11T02:23:32","slug":"how-to-change-timezone-date-and-time-in-linux-servers","status":"publish","type":"post","link":"https:\/\/webhostingnoida.in\/blog\/how-to-change-timezone-date-and-time-in-linux-servers\/","title":{"rendered":"How to Change Timezone, Date and Time in Linux servers"},"content":{"rendered":"<p>This blog post will help you change the timezone of the VPS server or dedicated server if you purchase CentOS\/RHEL Linux VPS server or dedicated server from our hosting service.Let&#8217;s explore Linux change timezone, Linux date command and Linux time commands with easy examples.<br \/>\nYou can easily change Linux date, time and timezone suitable to your working timezone.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-change-timezone-date-and-time-in-linux-servers\/#Date_Command\" >Date Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-change-timezone-date-and-time-in-linux-servers\/#Linux_Timezone_Config_Files\" >Linux Timezone Config Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-change-timezone-date-and-time-in-linux-servers\/#Linux_Change_Timezone\" >Linux Change Timezone<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-change-timezone-date-and-time-in-linux-servers\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h5><span class=\"ez-toc-section\" id=\"Date_Command\"><\/span><strong>Date Command<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>To see your present server date, time and time zone use below command.<\/p>\n<pre># date\r\nMon Oct 28 18:51:12 IST 2019<\/pre>\n<h5><span class=\"ez-toc-section\" id=\"Linux_Timezone_Config_Files\"><\/span><strong>Linux Timezone Config Files<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>CentOS stores all timezone configuration files in folder\u00a0<strong>\/var\/share\/zoneinfo\/<\/strong><\/p>\n<div class=\"bspr\">\n<p>The timezone config folder contains all timezone with their respective name. For Example: India timezone file will be located in <strong>\/var\/share\/zoneinfo\/Asia\/Kolkata<\/strong><\/p>\n<\/div>\n<div class=\"wrp cnt\">\n<div class=\"bSeCont\">\n<section class=\"bSe left\">\n<article>\n<div class=\"awr\">\n<div id=\"tve_flt\" class=\"tve_flt\">\n<div id=\"tve_editor\" class=\"tve_shortcode_editor\">\n<div class=\"thrv_wrapper thrv_text_element tve_empty_dropzone\">\n<p><strong>\/etc\/localtime &#8211;\u00a0<\/strong>This is a file which links to correct timezone file in \/var\/share\/zoneinfo\/<\/p>\n<\/div>\n<pre>ls -l \/etc\/localtime\r\nlrwxrwxrwx 1 root root 34 Mon 28 11:25 \/etc\/localtime -&amp;gt=;..\/usr\/share\/zoneinfo\/Asia\/Kolkata<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<\/section>\n<\/div>\n<\/div>\n<h5><span class=\"ez-toc-section\" id=\"Linux_Change_Timezone\"><\/span>Linux Change Timezone<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>The\u00a0<strong>timedatectl<\/strong>\u00a0command is a new command utility for\u00a0<strong>CentOS 7\/RHEL<\/strong> , It&#8217;s also a replacement for old traditional Linux\u00a0<strong>date<\/strong> command. The command output will be something like this.<\/p>\n<pre># timedatectl\r\nLocal time: Mon 2019-10-28 17:16:11 IST\r\nUniversal time: Mon 2019-10-28 06:36:11 UTC\r\nRTC time: Mon 2019-10-28 06:36:11\r\nTime zone: Asia\/Kolkata (IST, +0530)\r\nNTP enabled: yes\r\nNTP synchronized: yes\r\nRTC in local TZ: no\r\nDST active: n\/a<\/pre>\n<p>You can see \u00a0date, time and timezone information clearly with <strong>timedatectl<\/strong><\/p>\n<p>Let&#8217;s change server timezone to another. First, we need to figure out target timezone name. The below command will show all the available timezones on the server.<\/p>\n<p><strong># timedatectl list-timezones | less <\/strong><\/p>\n<p>To see all Asian countries timezone use below command.<\/p>\n<p><strong># timedatectl list-timezones | grep Asia \u00a0 \u00a0<\/strong><\/p>\n<p>Asia\/Dhaka<br \/>\nAsia\/Dili<br \/>\nAsia\/Dubai<br \/>\nAsia\/Hong_Kong<br \/>\nAsia\/Jakarta<br \/>\nAsia\/Jayapura<br \/>\nAsia\/Kabul<br \/>\nAsia\/Kamchatka<br \/>\nAsia\/Karachi<br \/>\nAsia\/Kathmandu<br \/>\nAsia\/Khandyga<br \/>\nAsia\/Kolkata<br \/>\nAsia\/Krasnoyarsk<br \/>\nAsia\/Kuala_Lumpur<br \/>\nAsia\/Kuching<br \/>\nAsia\/Kuwait<br \/>\nAsia\/Macau<\/p>\n<p>To set Linux timezone to Kuwait time, the syntax and actual command will look like this<\/p>\n<p><strong># timedatectl set-timezone time_zone<\/strong>\u00a0 \u00a0 &#8211; Syntax<\/p>\n<p><strong># datetimectl set-timezone Asia\/Kuwait<\/strong><\/p>\n<h5><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>We hope you learned how to change Linux\/CentOS\/RHEL timezones, linux time with simple commands. You can learn more from <strong>timedatectl<\/strong> command man pages.<\/p>\n<p>Feel free to give feedback or leave a comment.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post will help you change the timezone of the VPS server or dedicated server if you purchase CentOS\/RHEL Linux VPS server or dedicated server from our hosting service.Let&#8217;s explore Linux change timezone, Linux date command and Linux time commands with easy examples. You can easily change Linux date, time and timezone suitable to<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-linux-commands"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":11,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":69,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts\/29\/revisions\/69"}],"wp:attachment":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}