To set the Operating System time you use the "date" command:
- Code: Select all
date 05281304
The format is MMDDHHmm
If you also need to set the year you can add the year after all the other values:
- Code: Select all
date 052813042016
The format is MMDDHHmmYYYY
The hardware clock then also needs to be updated to ensure that the system will have the correct time when it is restarted again.
Use this command:
- Code: Select all
hwclock --systohc
This uses the system time to set the hardware clock.