LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Clock on wrong time (https://www.linuxquestions.org/questions/linux-general-1/clock-on-wrong-time-27453/)

bripage 08-07-2002 10:48 PM

Clock on wrong time
 
My clock is showing the wrong time. How can I get it back to the right time?

BinaryBob 08-07-2002 10:54 PM

use date
 
to set the time use the following comand:

Code:

date MMDDhhmm
MM: Month - 08
DD: Day - 07
hh: the current hour in 24 hour time
mm: the current minute use 2 digits, like 09

so for me i would type:

Code:

date 08072050
hope that helps

bripage 08-07-2002 11:04 PM

nope... al it does is print:

Thu Aug 8 12:06:32 2002 -0.6 blahblah seconds

Thats not the correct time... GRRRRR!

jeepix 08-08-2002 05:38 PM

You have to use the -s argument to set the time. Try man date to see the full usage of date. Also, you must have root level privileges.

scott@linuxbox:~> date
Thu Aug 8 17:34:49 CDT 2002
scott@linuxbox:~> date -s 19:04
date: cannot set date: Operation not permitted
Thu Aug 8 19:04:00 CDT 2002
scott@linuxbox:~> date
Thu Aug 8 17:34:59 CDT 2002 <-- Notice it didn't change
scott@linuxbox:~> su root
Password:
scott@linuxbox:/home/scott# date -s 19:05
Thu Aug 8 19:05:00 CDT 2002
scott@linuxbox:/home/scott# exit
scott@linuxbox:~> date
Thu Aug 8 19:05:12 CDT 2002

crabboy 08-08-2002 08:45 PM

You can look into 'ntpdate' to sync your date/time with a time server.
Code:

# ntpdate tick.usno.navy.mil
 8 Aug 21:43:19 ntpdate[25341]: adjust time server 192.5.41.40 offset 0.000404 sec



All times are GMT -5. The time now is 12:00 AM.