You are not logged in.

#1 2009-12-02 20:38:40

haikuhacker
Member
Registered: 2009-11-28
Posts: 39

What Time Is It?

No matter what I do with the "Time and Date" system utility. My system clock is 8 hours slow. Wether I use the NTP daemon or not. In fact if I try to manually set the time it rolls it back 8 hours before I can close the window. If I change the time zone to 8 hours east of here, it is reset on the next boot. Is there a file I can edit so that my system time agrees with my bios settings?


Salix-13.37-64-XFCE/Spectrwm Archbang/Razor-QT
Intel® Atom™ Processor D510
NVIDIA® GeForce™ 6200

Offline

#2 2009-12-02 20:44:59

Tomone
Member
Registered: 2009-09-29
Posts: 18

Re: What Time Is It?

Can't you just set the time with the rc.conf file? In mine I just have HARDWARECLOCK="UTC" and TIMEZONE=<myTimeZone>

Offline

#3 2009-12-02 20:50:41

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: What Time Is It?

I don't mean to steal your thread, but I have a somewhat related problem. I can change the time, but once I reboot it won't boot up with errors about the time being fucked up. I have to boot into the fallback kernel and reset the time. hmm


dnyy in IRC & Urban Terror

Offline

#4 2009-12-02 21:06:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: What Time Is It?

> I have to boot into the fallback kernel and reset the time.
Why? Fix it once and for all? There's a bunch of related threads and a wiki entry.

Can't you remount the partitions w/ the correct time? If you do that will there be errors on the next reboot?

Offline

#5 2009-12-02 22:26:48

leepesjee
Member
Registered: 2008-11-06
Posts: 57

Re: What Time Is It?

haikuhacker, setting the clock can be very confusing, I know from experience.
A few things to notice: you have your system time and you have the hardware clock (hwclock) setting. System time is derived at boot from the hwclock and the settings of  HARDWARECLOCK and TIMEZONE  in /etc/rc.conf.
If HARDWARECLOCK="localtime", it is supposed that the hwclock is set at local time, which means that no conversion is done and sytem time=hwclock setting. If HARDWARECLOCK="UTC", it is supposed that the hwclock is set to UTC, which means that the system time gets a conversion depending on your timezone.

You have to check these setting and decide if they are set to your preference (you might want "localtime" if you dual boot with Windows, as Windows sets the hwclock to localtime, otherwise, "UTC" is recommended).

The date command only sets the system time, which gets reset at boot. If you want to set the hwclock you have to use the hwclock command. If you do that, be sure that you understand the use of the --localtime and --utc flags. They are to instruct the hwclock command as how the hwclock is set (localtime or utc). For instance:

hwclock --systohc --localtime

sets the hwclock to the current system time (would you have used --utc, it would have used a difference, depending on TIMEZONE.

Hope this helps.

Last edited by leepesjee (2009-12-02 22:27:23)

Offline

#6 2009-12-02 22:31:17

YamiFrankc
Member
From: Mexico
Registered: 2009-06-19
Posts: 177
Website

Re: What Time Is It?

I have this exact problem on every fresh install on this laptop.
Heres how i fix it: http://yamifrankc.wordpress.com/2009/11 … -on-linux/

" As non root user to the "date" command, it will output something like this:

    ┌─[yamifrankc]──(~)
    └─| % > date
    Sun Nov  8 08:20:41 CST 2009

Now, as root(you can use Sudo of course):

# date mmddttttyyyy.ss

    * mm = Mont number
    * dd = Day number
    * tttt = Time in 24 hours format (13:45 for example)
    * yyyy = Year
    * ss = Seconds

You can, of course run it without the seconds variable. Lets see my output:

    ┌─[yamifrankc]──(~)
    └─| % > !! date 110814252009
    Password:
    Sun Nov  8 14:25:00 CST 2009

Yours should look like mine.

[Note]: I have aliased !! to be sudo on my .zshrc , I will explain how to do it later on both Bash and Zsh.

Awesome, now our Linux install "know" the current time, but our system doesn't ,if we restart we will have the incorrect time again. Lets fix it.

As root do:

    #  hwclock –systohc

And now your system will have the correct date after you reboot. "[

Last edited by YamiFrankc (2009-12-02 22:31:55)


Thanks and greetings.

Offline

#7 2009-12-02 22:44:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: What Time Is It?

Does removing /var/lib/hwclock/adjtime help?

> [Note]: I have aliased !! to be sudo on my .zshrc , I will explain how to do it later on both Bash and Zsh.
And what is your alias for '!!'? Plus, I find it easier to type 'sudo' than '!!'.

Offline

#8 2009-12-03 00:29:58

leepesjee
Member
Registered: 2008-11-06
Posts: 57

Re: What Time Is It?

YamiFrankc,

I would use sort of the same route to set the hardware clock. However I find your use of the term "system" confusing. In hwclock terms "system" denotes the current time om your running linux kernel, not the setting of your hardware clock. Just as --systohw means 'system (clock) to hardware (clock)'.

Offline

Board footer

Powered by FluxBB