Time zone settings in Linux
Let's learn how to do time and zone setting in Linux
Photo by Agê Barros on Unsplash
AIM – To change the time zone setting in Linux System. The new time zone must be Asia/Kolkata.
Check the OS distribution by
cat /etc/os-release
To check the date on the system use:
date
To see the current time zone use:
timedatectl
To see all the time zone in the system use:
timedatectl list-timezones
To see if the time zone of Asia/Kolkata is present in the system or not:
timedatectl list-timezones | grep Asia/Kolkata
To change the time zone into the time zone of Asia/Kolkata
timedatectl set-timezone Asia/Kolkata
Now check the time zone again using the command:
date
To see the changes that we just made:
timedatectl status
To change the time use:
timedatectl set-time ‘2023-06-08 16:46’
To sync the hardware clock with the system clock, use:
timedatectl set-local-rtc 0