I was getting headache when I am trying to fix the time of a Linux Mint server PC. The current time was suddenly become 1 hour ahead the correct time. I don’t know how or when did it happen. I have googled a lot to find a solution but I couldn’t find a simple ‘how to’. My problem looks similar to this.
ali@merbabu:~$ date -u Wed May 25 01:13:38 UTC 2016
The UTC time shows 01:13:38 instead of 02:13:38.
Please take a note that in this case, NTP is not an option because the ISP that I am using is blocking the protocol. So, if I am able connect to the NTP service, I would like to use NTP instead of changing the time manually.
So, here is the solution:
- Change the current default time zone to UTC:
ali@merbabu:~$ sudo dpkg-reconfigure tzdata
There will be several options. Choose ‘None of the above’, then choose ‘UTC’.
Current default time zone: 'Etc/UTC' Local time is now: Wed May 25 01:14:04 UTC 2016. Universal Time is now: Wed May 25 01:14:04 UTC 2016.
- Change/set the system time to the correct time:
ali@merbabu:~$ sudo date --set 02:17:30 Wed May 25 02:17:30 UTC 2016
- Set the hardware/BIOS time to match the system time:
ali@merbabu:~$ sudo hwclock --systohc --utc ali@merbabu:~$ date Wed May 25 02:17:41 UTC 2016