Here’s a short and easy way to set your system and hardware clock from the command line.
Open your terminal and follow these steps.
First check the current time of your hardwareclock:
hwclock -r
Then add the right date/time to your systemclock.
In the example provided you’ll find some strange long number.
You have to read it like this (from left to right):
[01] = month (Jan) | [14] = day | [0231] = time (02:31) | [2011] = year
sudo date 011402312011
Now sync your hardware clock with the date/time you’ve just set:
sudo hwclock --systohc
Check if the hardware clock is synced right:
sudo hwclock -r
Profit!
One thought on “Changing date and/or time on Linux”