Search My Techie Guy

Wednesday, August 13, 2014

Change system Date and Time - Linux

Problem:

I want to adjust the system date and time

Solution:

1. Run the command "date" to get the current system date and time, and also the string format because you are going to use the same format in the next command.
# date
Wed Aug 13 14:52:35 EAT 2014

2. Use this command to set the correct date and time.
# date --set="Wed Aug 13 15:18:00 EAT 2014"
Wed Aug 13 15:18:00 EAT 2014

3. Check if the system time is consistent with the hardware clock
# hwclock --show
Wed 13 Aug 2014 03:59:24 PM EAT  -0.516957 seconds

4. Use the system date and time to update the hardware clock
# hwclock --utc --systohc

No comments: