LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting the clock (https://www.linuxquestions.org/questions/linux-newbie-8/setting-the-clock-370783/)

dasy2k1 10-07-2005 07:08 PM

setting the clock
 
how do i set the clock on my slackware 9.1 system as it is wrong. and all teh install offered me was is this A correct or B utc, diddnt offer, C plain wrong!

what is the comeand to do this? and do i need to be root to do this?

btmiller 10-07-2005 08:19 PM

Yes, you need to be root, the command is:

date -s <date string>

e.g.

date -s "Fri Oct 7 21:19:13"

bigrigdriver 10-07-2005 11:11 PM

There are two commands that must be used in the correct order to get it to work properly: date and hwclock.

I don't remember the order, nor the options.

Google on those two keywords: date hwclock. You should easily turn up a document relative how to used them in the correct order, and which options to use.

I did it a couple of months back. Thought I'd saved a copy of the instructions, but I can't find them.

imitheos 10-08-2005 07:50 AM

Re: setting the clock
 
Quote:

Originally posted by dasy2k1
how do i set the clock on my slackware 9.1 system as it is wrong. and all teh install offered me was is this A correct or B utc, diddnt offer, C plain wrong!

what is the comeand to do this? and do i need to be root to do this?

Firstly, see if "/etc/localtime" is linked to the right timezone for you.
If yes then you see if "hwclock" has the right setting
see if "/etc/hardwareclock" has "UTC" or "localtime" and change accordingly to what you want.

then run date and set the right hour.

You can change all this interactively without messing with all these files i mentioned by running "timeconfig" as root and it will
ask you the same questions as the installation did.
This way you can set it in 2 seconds but i mentioned the manual way too just for the sake of knowledge.

dasy2k1 10-08-2005 08:01 AM

thanks for that, both my hardware clock and system clock are now coirrect though not exactly teh same as each other :confused:

but is will do.

dracolich 10-08-2005 10:53 AM

One thing that's often overlooked is the hwclock parameters. After setting the time with date you can use hwclock --systohc to set the new system time to the hardware clock so they are both the same.

dasy2k1 10-08-2005 02:19 PM

well it synced on systrem halt though with otehr problems to the system i am reinstalling (see post about grub error 17 in newbie forum)


All times are GMT -5. The time now is 11:36 AM.