You are not logged in.

#1 2007-11-20 19:55:06

insane_alien
Member
Registered: 2007-11-19
Posts: 39

Can't set the time.

okay, so i thought i was pretty good with linux but this rather embarassingly has me stumped.

i just got arch up an running the way i like but i can't change the time on the clock which is currently displaying 4am despite it being  8pm. the timezone is correct and the hardware clock (looking in BIOS) says it's 8pm so how can i change it in arch?

if you need outputs or file contents just give a shout and i'll supply

Offline

#2 2007-11-20 20:55:32

FizDev
Member
From: Canada
Registered: 2007-06-29
Posts: 57

Re: Can't set the time.

Use date! Run it as root
Example :

date -s 20:00

For more info on the different options of "date"

man date

Last edited by FizDev (2007-11-20 20:57:00)

Offline

#3 2007-11-20 21:08:41

insane_alien
Member
Registered: 2007-11-19
Posts: 39

Re: Can't set the time.

thanks

i've never had to set the time by CLI before. its always just worked so i never came across it.

Offline

#4 2007-11-21 01:13:37

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: Can't set the time.

You can use a ntp server to automatically set the correct time.

Offline

#5 2007-11-21 09:37:08

mico
Member
From: Slovenia
Registered: 2004-02-08
Posts: 247

Re: Can't set the time.

insane_alien wrote:

... clock which is currently displaying 4am despite it being  8pm. the timezone is correct and the hardware clock (looking in BIOS) says it's 8pm ...

Your time is probably set to UTC in /etc/rc.conf:
HARDWARECLOCK="UTC"
And your time in BIOS is now probably 4h late. Which is totally ok and in my opinion the preferred way, but some other systems like Windows (if arch is not the only system installed) could show BIOS time as your local time by default and you have to tell such systems you are using UTC time.

As fumbles suggested you can install ntp, it's great, just tell all other systems (if you have more installed) not to change your time for DST changes because NTP does that for you, just add ntpd to your daemons in rc.conf.

Offline

#6 2007-11-21 10:15:30

insane_alien
Member
Registered: 2007-11-19
Posts: 39

Re: Can't set the time.

my timezone in rc.conf is set to Europe/London. which atm is exactly the same as UTC.  i have added ntp but it didn't do much. i'll get it running sooner or later. still realising how easy ubuntu made everything for me.

my list of things to get working is pretty small now, just ntp, wicd(for roaming WPA and because i'm used to it), compiz-fusion. the only one of those i've done anything on is ntp so it should all be good.

nice to see the community doesn't mind a few nooby questions every now and again.  thanks again.

Last edited by insane_alien (2007-11-21 10:16:10)

Offline

#7 2007-11-21 14:11:33

mico
Member
From: Slovenia
Registered: 2004-02-08
Posts: 247

Re: Can't set the time.

insane_alien wrote:

i have added ntp but it didn't do much.

That's ok, it is supposed to not do much in a short time because a sudden change in system time could disrupt some programs, e.g. a screensaver could lock immediately because it thinks so much time has passed without user activity. You can run:

ntpdate pool.ntp.org

to change time immediatelly. If it complains about NTP socket in use, then stop ntpd daemon and retry.

Offline

#8 2007-11-21 14:47:20

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Can't set the time.

See wiki. The proper way is to add both ntpdate and ntpd to DAEMONS in /etc/rc.conf, in that order.

Offline

#9 2007-11-21 15:03:40

insane_alien
Member
Registered: 2007-11-19
Posts: 39

Re: Can't set the time.

thanks guys, thats ntp working perfectly now.

Offline

Board footer

Powered by FluxBB