Timezone Asia/Kolkata changed to PST
Sebastian Wright
What I did:
Ran this command:
sudo cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtimeWhat happened:
My local time changed to PST. Now I ran:
sudo cp /usr/share/zoneinfo/Asia/Kolkata /etc/localtimeBut my system time didn't change back to IST. Instead, it's showing PST's time with the IST label.
(In picture: I'm pointing to IST Kolkata, but the time zone highlighted is Los Angeles. This may explain my problem.)
Expected result:
I want Asia/Kolkata to be back to normal.
P.S.: With the command
sudo timedatectl set-timezone Asia/Kolkatathe timezone changed to IST with PST's time.
3 Answers
Uninstalling and reinstalling tzdata solved my problem:
sudo apt-get remove tzdata
sudo apt-get install tzdata That's not the correct way to change the timezone in command line.
To reset your clock:
sudo apt install ntpdate
sudo ntpdate -s ntp.ubuntu.com
sudo dpkg-reconfigure tzdata
Select the correct timezone from the menu.
Next time if you want to set your timezone from command line:
timedatectl set-timezone [Region]/[City]
This will set timezone to Asia/Kolkata. timedatectl manages the time settings of your system.
sudo timedatectl set-timezone Asia/KolkataTo view available list of timezones enter,
timedatectl list-timezonesEdit : I understand that your system S/W time is messed up. In this case use your hardware clock to set your system time by using the command below.
sudo hwclock --hctosys 3