Change timezone in Linux

In this tutorial, I will change timezone in Linux by command line. How to change the to your current time zone.

  • The location of the local time file in Linux is /etc/localtime.
  • Timezone files are located in /usr/share/zoninfo/

To change the timezone in the Linux command line, you can use the methods below, which are available on most modern Linux distributions. Here’s how you can do it:

How to Change Timezone in Linux with Two Methods.

Method 1: I will copy from /usr/share/zoneinfo/Asia/Ho_Chi_Minh to /etc/localtime

$ sudo cp /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime

Method 2: I will delete and make a symbolic Linux from //share//Asia/Ho_Chi_Minh to /etc/ as following below

$ sudo rm -f /etc/localtime
$ sudo ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime

Verify the new timezone:

Conclusion

After changing the timezone, you may need to restart services or applications that rely on the system time to ensure they reflect the new timezone.

You changed your current timezone You can type date command to verify and you’re done. I hope this is helpful you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.