Friday, June 1

How to Change Time Zone in Linux RHEL/CentOS 6&7


Time Zone change is required Some times  when we move our Machines(VMs) from one location to another location.
You can easily change timezone in RHEL/CentOS using the following methods.
Check which time zone you are in by using date command.

Example:
[root@bsrtech ~]# date
Fri Jun  1 12:26:53 IST 2018

Actually My Machine(VM) is moved from India to US(Eastern Time)  Data Centre. Here i am showing change time zone from IST to EDT.

In Linux timezone data is taken from /etc/localtime which is linked to one of the file located in /usr/share/zoneinfo/*
Delete the current localtime file under /etc/ directory, before deleting backup the localtime file

[root@bsrtech ~]# cd /etc
[root@bsrtech ~]# cp /etc/localtime /etc/localtime_bkp_8MAR2018
[root@bsrtech ~]# rm localtime

All US timezones are located under the /usr/share/zoneinfo/US directory as shown below.

[root@bsrtech US]# ls
Alaska    Arizona  Eastern       Hawaii          Michigan  Pacific      Samoa
Aleutian  Central  East-Indiana  Indiana-Starke  Mountain  Pacific-New




Note: For other country timezones, browse the /usr/share/zoneinfo directory.

Link the Eastern file from the above US directory to the /etc/localtime directory as shown below.

[root@bsrtech US]# # ln -s /usr/share/zoneinfo/US/Eastern   /etc/localtime

Now the timezone on your Linux system is changed to US Eastern time as shown below.

[root@bsrtech ~]# date
Fri Jun  1 03:19:21 EDT 2018

Note: The date command can be used for both viewing and changing the date and time. Change the Time using date Command

Set Manual Time
[root@bsrtech ~]# date -s "01 JUNE 2018 02:34:00"
FRI June  1 02:34:00 EDT 2018

8 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.

      Spring Training in Chennai

      The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. Thanks For Sharing a very Nice Informative Information which I very Beneficial for everyone Otherwise if anyone Want to Setup / activate Ms Office So Please visit the Website- https://msofficeset-up.com/

    Here is the best Software Company for MS Office Set up
    www.office.com/activate
    office.com/activate

    ReplyDelete
  3. Thank you for sharing this post its very knowledgeable i hope that you will continue to post these kinds of contents in future apart from that if anyone looking for Advance Excel institute in delhi so Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/Courses/business-analytics/adv-excel-training-course

    ReplyDelete
  4. Your post is really good thanks for sharing these kind of post but if anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in mumbai, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-mumbai.html

    ReplyDelete
  5. A big thank you for sharing this content If anyone looking for best Sas training institute in Delhi Contact Here-+91-9311002620 Or Visit our website https://www.htsindia.com/Courses/business-analytics/sas-training-institute-in-delhi

    ReplyDelete

:: Linux - Legends ::