You are not logged in.

#1 2011-07-31 04:41:50

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

clock out of sync again

ok, the clock, i cant get it right.

using KDE, i cant seem to get my clock to display what i want.  since the new deprecation for the timezones, i have had problems.  i went through the entire tutorial a couple times, and have made manual adjustments to files, and clock alike. 

my clock is still about 7 hrs behind, which is my timezone, PST (los angeles) -8GMT, with daylight savings time is -7GMT, or vice versa.

anybody have any foolproof suggestions?


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#2 2011-07-31 04:50:27

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: clock out of sync again

You are mistaken. Timezone support has not been dropped from rc.conf.

Describing what changes you made and what did not work, would be helpful. Failing that, read this : https://wiki.archlinux.org/index.php/Time#Time_Skew


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-07-31 05:15:39

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

Re: clock out of sync again

Offline

#4 2011-07-31 06:22:24

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: clock out of sync again

I don't think that is in the repos yet. From the looks of it, the devs are still discussing it.

initscripts got updated for me as well, but the pacnew didn't mention anything about deprecating TIMEZONE. it only mentioned about VERBOSE being deprecated.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2011-07-31 06:33:07

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

Re: clock out of sync again

Inxsible wrote:

I don't think that is in the repos yet. From the looks of it, the devs are still discussing it.

Yup, it's not in any repos yet.

@wolfdogg

TZ="America/Los_Angeles" date

shows the correct date & time for L.A.

Please post the output of 'hwclock --debug' and 'date'.

Offline

#6 2011-08-01 05:53:23

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

$hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/07/31 22:54:17
Hw clock time : 2011/07/31 22:54:17 = 1312178057 seconds since 1969
Sun 31 Jul 2011 10:54:17 PM PDT  -0.344427 seconds
$ date
Sun Jul 31 15:54:38 PDT 2011

i dont want to skew the time, will just cause confusion down the road if you ask me. i read the whole wiki, and tried everything on there, maybe not in the correct order.  i would just rather explain to arch what time it really is if possible...

Last edited by wolfdogg (2011-08-01 06:01:30)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#7 2011-08-01 08:43:10

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: clock out of sync again

wolfdogg wrote:

i dont want to skew the time, will just cause confusion down the road if you ask me.

No one wants to, but it does over time anyway.

The link I provided helps in getting rid of that skew.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2011-08-01 13:33:26

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

Re: clock out of sync again

wolfdogg wrote:

Assuming hardware clock is kept in local time.

Could you remind me, why aren't you using UTC?

Offline

#9 2011-08-01 18:17:42

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

i had it as utc first but ran into errors. 
i would like my cmos to reflect local time, and i would like my system clock local time.
shouldnt the hardware clock = cmos clock?

should i be using utc?  i wouldnt mind it  as long as the clock reflects properly i guess

Last edited by wolfdogg (2011-08-01 18:30:04)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#10 2011-08-01 18:53:35

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: clock out of sync again

wolfdogg wrote:

i had it as utc first but ran into errors.

what errors? roll

UTC is recommended if you are not dual-booting with Windows. However, even Windows now supports UTC. There is regex variable to be set. Google it. If you are not dual-booting with Windows, then it is highly recommended that you use UTC.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#11 2011-08-01 19:00:06

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

Re: clock out of sync again

Inxsible wrote:

There is regex variable to be set. Google it. If you are not dual-booting with Windows, then it is highly recommended that you use UTC.

A "regex variable"? You mean Windows Registry, right? ;P

[karol@black ~]$ cat ~/docs/code/WindowsTimeFixUTC.reg 
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=dword:00000001


Let's try again. Please follow the wiki on how to set time and report any errors you get.

Last edited by karol (2011-08-01 19:02:18)

Offline

#12 2011-08-01 20:34:25

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

the error i was referring to  was the time being displayed incorrectly, i mispoke.  i had it set at UTC, and with my timezone set to Los Angeles, it looks no different than when i set the HW clock to Los Angeles, and system clock to Los Angeles. 

i guess i can go through it again.

ok, after entering this

grep ^HARDWARECLOCK /etc/rc.conf
hwclock --utc
HARDWARECLOCK="UTC"
grep ^TIMEZONE /etc/rc.conf
cp /usr/share/zoneinfo/America/Chicago /etc/localtime

this set my current time to 5 hours behind, and my UTC to -12 hours behind, this is probably because the time was wrong to begin with.

then using KDE i set the time to current, which is 1:44pm

now

hwclock --show

reflects 1:44pm
by now im a bit confused. 
i thought HW clock, was my cmos, not arch.

# date
Mon Aug  1 13:46:47 CDT 2011

now next time i edit my cmos clock which i alter my systems over here regularly, i will have to remember that i just changed my lifetime format from localtime to UTC, and have to first figure out if daylight savings time is in effect, to see if Pacific time is -7 or -8 currently, then add that to my local time to get UTC time.  see how confusing setting CMOS to UTC is....

ok, i will admit the above was sort of a rant and to highlight the problems one may run into...

now, back to square 1,

ok

# hwclock --show

displays

Mon 01 Aug 2011 01:50:57 PM CDT  -0.172132 seconds

and

# date

displays

Mon Aug  1 13:52:03 CDT 2011

but since i have a timezone set, why is HW clock (aka cmos) displaying the same as my desktop clock, when i set the HW clock for UTC?

Last edited by wolfdogg (2011-08-01 20:51:24)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#13 2011-08-02 00:24:40

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: clock out of sync again

wolfdogg wrote:

...

but since i have a timezone set, why is HW clock (aka cmos) displaying the same as my desktop clock, when i set the HW clock for UTC?

From 'man 8 hwclock' [I added the italics]:

-r, --show
       Read the Hardware Clock and print the time on Standard Output.  The  time
       shown  is  always  in local time, even if you keep your Hardware Clock in
       Coordinated Universal Time.
See the --utc option.

Offline

#14 2011-08-02 02:14:29

Wittfella
Member
From: Australia
Registered: 2008-05-27
Posts: 462

Re: clock out of sync again

Yeah it's a bit confusing, the hwclock will show the cmos clock time adjusted for your timezone, so basically the same as the date command.

Try

hwclock --debug

You will see the 'real' cmos time in UTC, before the timezone adjustment.

Last edited by Wittfella (2011-08-02 02:15:16)

Offline

#15 2011-08-02 02:39:34

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

oh yes, thats right.

maybe its correct now then,

$ hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1312224343 seconds after 1969
Last calibration done at 1312224343 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/08/01 19:38:56
Hw clock time : 2011/08/01 19:38:56 = 1312252736 seconds since 1969
Mon 01 Aug 2011 07:38:56 PM PDT  -0.275713 seconds

and its , err well, i was going to look at my desktop clock to check the time and it says 12:40pm.  it should be saying 7:38pm.  so its now at 7hr behind.  what should i do next?  it looks like the system time is correct, well partially, but correct me if im wrong, but in UTC the date should say the 2nd of august here, not the 1st of august.  but it should be near 01:38 Aug. 2nd UTC and 7:38pm my time, or in 24hr format 19:38 Aug.1st  my time.

so since date on the bottom of the above output, assuming thats the system time, is correctly reflecting -7hrs from the UTC time, then i think the timezone is correct, but it looks like i now need to set the UTC time correctly.  I thought if i set my clock on my desktop (KDE) it would have altered the Hardware clock though, but since i rebooted it went back.

Last edited by wolfdogg (2011-08-02 02:46:53)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#16 2011-08-02 02:41:09

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

Re: clock out of sync again

Hardware clock is on local time
Assuming hardware clock is kept in local time.

I still don't get why it's not on UTC. Can you explain it one last time?

Offline

#17 2011-08-02 02:51:06

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

hmm, i dotn know why, i ran the above command lines you see. 
i was just going to take a different approach, and ill try and answer your question after words.

i went to this website
http://wwp.greenwichmeantime.com/
and just ran this command

hwclock --set --date "08/02/2011 02:48:35"

then i ran the debug output again

# hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1312278515 seconds after 1969
Last calibration done at 1312278515 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/08/02 02:48:57
Hw clock time : 2011/08/02 02:48:57 = 1312278537 seconds since 1969
Tue 02 Aug 2011 02:48:57 AM PDT  -0.219164 seconds

  i see what you mean, its still on local time, ill run the command again to set it for UTC, ill see if i can get that to stick.

Last edited by wolfdogg (2011-08-02 02:52:27)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#18 2011-08-02 02:59:10

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

Re: clock out of sync again

https://wiki.archlinux.org/index.php/Time#Time_Set

hwclock --set --date "08/02/2011 04:58:00"
hwclock --hctosys

Offline

#19 2011-08-02 03:07:33

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

ok, i think i FOUND THE MAIN PROBLEM, the line in my rc.conf was commented out

#HARDWARECLOCK="localtime"
this explains why grep wasnt reporting the variable back when i ran the command 

grep ^HARDWARECLOCK /etc/rc.conf

i uncommented the line, and tried to see if i could change the variable through the commands.  i dont quite understand what command actually alters the TIMEZONE= variable on the rc.conf. so i did a manual edit.  i now have rc.conf as follows

HARDWARECLOCK="UTC" 
TIMEZONE="America/Los_Angeles"

the debug shows this now

# hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1312278515 seconds after 1969
Last calibration done at 1312278515 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/08/02 03:07:16
Hw clock time : 2011/08/02 03:07:16 = 1312279636 seconds since 1969
Tue 02 Aug 2011 03:07:16 AM PDT  -0.656650 seconds

now if i can figure why it still reports its on local time.. maybe i need to reset my timezone?

-------------
edit
sorry Karol, i mised that last post, thats basically what i did, and i just set the hc to sys clock per your post, no change on the debug output.  where shoudl i go from here?  ill stop until i get a concrete suggestion.

Last edited by wolfdogg (2011-08-02 03:14:37)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#20 2011-08-02 03:26:52

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

Re: clock out of sync again

Reboot and check the output of 'hwclock --debug' again. If it's still stubborn on being kept in local time, please post your rc.conf.

Offline

#21 2011-08-02 07:37:21

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

LOCALE="en_US.UTF-8"
HARDWARECLOCK="UTC" 
TIMEZONE="America/Los_Angeles"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(fuse)

USELVM="no"

HOSTNAME="xxxxxx"

eth0="dhcp"
INTERFACES=(eth0)

gateway="default gw xxx.xxx.xxx.xxx"
ROUTES=(!gateway)

DAEMONS=(syslog-ng @network @dnsmasq @sshd @samba @smbnetfs !netfs dbus crond @mysqld @httpd @proftpd @alsa kdm !cups)

Last edited by wolfdogg (2011-08-02 07:38:47)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#22 2011-08-02 15:58:24

chakra-user
Member
Registered: 2010-03-07
Posts: 74

Re: clock out of sync again

Having the exact same problem as the original poster. I am dual booting windows and arch and cannot keep bios time in UTC as during any scenario of setting bios time, I am not going to sit and calculate UTC time but going to see my watch and set the bios time so it will be only localtime.

I have also tried adding hwclock to DAEMONS in /etc/rc.conf but for some reason either it is not loading on start up OR it simply does not work as the time is still some wierd time for instance time right now is 9:25 PM IST and it is showing 2:30 AM

Anyone has any idea how to bring my system to pre-update state where the Time was being saved and restored perfectly along with bios time being in local time?

Relevant portions of /etc/rc.conf


LOCALE="en_US.utf8"
DAEMON_LOCALE="yes"
HARDWARECLOCK="localtime"
TIMEZONE="Asia/Calcutta"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
...


DAEMONS=(hwclock @syslog-ng @net-auto-wired @crond !avahi-daemon !avahi-dnsconfd @alsa !cdemud @cups @sensord kdm)

Thanks.

Last edited by chakra-user (2011-08-02 16:00:48)

Offline

#23 2011-08-02 16:12:39

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: clock out of sync again

chakra-user wrote:

....as during any scenario of setting bios time, I am not going to sit and calculate UTC time but going to see my watch and set the bios time...

why do you need to ? Just use the hwclock --systohc option to set it. or you could go into your BIOS and simply toggle a flag to set it to UTC.

Windows also supports UTC now, atleast 7 does.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#24 2011-08-02 16:17:23

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

Re: clock out of sync again

[karol@black ~]$ LC_ALL=C hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1312255440 seconds after 1969
Last calibration done at 1312255440 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/08/02 16:15:03
Hw clock time : 2011/08/02 16:15:03 = 1312301703 seconds since 1969
Tue Aug  2 18:15:03 2011  -0.909321 seconds

The hw clock is kept on UTC and it shows UTC time:

Time read from Hardware Clock: 2011/08/02 16:13:17
Hw clock time : 2011/08/02 16:13:17 = 1312301597 seconds since 1969

The last line shows the date

Tue Aug  2 18:15:03 2011  -0.909321 seconds
[karol@black ~]$ LC_ALL=C date
Tue Aug  2 18:15:50 CEST 2011

I am not dualbooting though.

Offline

#25 2011-08-02 16:53:39

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: clock out of sync again

I dual boot with Win 7 and, for me at least, setting up the ntp daemon was the best solution I found.  Win 7 also has a method to sync the clock there to a time server too (rightclick the clock in the tray and click on "Internet time" IIRC).  I also put Win 7 to use UTC time with the registry trick.

So far this works for me no matter what time my bios's clock says, as the ntp daemon syncs both about 30s after I boot up arch.

Offline

Board footer

Powered by FluxBB