You are not logged in.

#1 2007-04-23 02:26:15

RobF
Member
Registered: 2006-10-10
Posts: 157

[SOLVED] Timezones UTC and EDT all mixed up

I have the following settings in rc.conf:

HARDWARECLOCK="localtime"
TIMEZONE="Eastern US"

The clock in the lower right panel does indeed indicate the time in EDT.  However, as a screensaver I use the big analog clock and I also put an analog clock in the Arch login window.  Both of these clocks show the time in UTC, i.e. 4 hours ahead of EDT.  What's worse, the time stamping of all saved files, logs, etc. is also in UTC, and the "date" command shows time in UTC.  I believe this is the result of my at one time having run

# date -u

How do I reverse this so that all clocks and timestamping are synchronized to EDT?

Last edited by RobF (2007-04-23 19:49:12)

Offline

#2 2007-04-23 03:46:58

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: [SOLVED] Timezones UTC and EDT all mixed up

what does it show if you do hwclock (or hwclock --show)? do you dual boot with windoze?

Offline

#3 2007-04-23 05:40:29

RobF
Member
Registered: 2006-10-10
Posts: 157

Re: [SOLVED] Timezones UTC and EDT all mixed up

"hwclock" gives the time in UTC.

After I ran hwclock, I went into the BIOS.  The date and time in the BIOS was set for UTC time.  I reset that to the EDT time and then did a warm reboot.  That didn't make any difference in Arch.

I do dualboot into Windows XP.  The time there is correct (i.e. shows it in EDT), both in the taskbar and when running "time" from the DOS CLI.

After resetting the BIOS and checking these things in Windows, I did a cold reboot into Arch.  Now, in Arch, the login clock and the screensaver clock show the correct time (in EDT).  The "date" as well as the "hwclock" command also give the correct time (in EDT) but they say that it's UTC!  However, the clock in the bottom panel now runs 4 hrs. behind.  When I right-click on this clock and choose "Adjust Date & Time", the "Configure - KDE Control Module" window that comes up shows the correct time (in EDT) and the entry "New York - America/US - Eastern Time" in the "change timezone" box is highlighted but underneath that box it says "Current local timezone: America/New York (UTC)".

When I highlight another entry in this change timezone box and then go back to the entry "New York - America/US - Eastern Time" and click on Apply, the clock in that box resets to 4 hours earlier.  When I then redial the clock to the correct EDT time (with the up and down buttons) and hit <Enter>, it shows the correct EDT time and the line underneath the change timezone box now reads "Current local timezone: America/New York (EDT)".  Also, the clock in the bottom panel now shows the correct EDT time.

When I now run the "date" command, it gives the time 4 hours ahead and says it's UTC (which is correct).  When I save a file, it's timestamped to this UTC time.  But I don't want to have all files and logs timestamped to UTC!!  hwclock now gives the correct EDT time but says that it's UTC!

It gets worse.  After making all of these changes, I did a cold reboot into Arch.  Now the login clock and screensaver clock are back again to running 4 hrs. ahead (i.e. giving UTC time), and similarly the date and hwclock commands again give the time 4 hrs. ahead and say it's UTC (which is correct).  And the KDE time & date adjust box again says "Current local timezone: America/New York (UTC)".  I.e. any adjustment I make through the KDE Control Center Module doesn't survive a reboot.  It looks as though the "date -u" command overrides everything.  If only I could reset the "date" command to printing EDT time (which I believe is the default that was used before I ran the date  -u command)!  I've looked everywhere but haven't found a way to undo this -u switch and return to the default.

FWIW, I should say that I installed OpenNTPD, and I'm now running the ntp daemon (ntpd) on startup.  I did this after I became aware of this time readout problem but running ntp didn't change anything.

Needless to say, I'm rather confused.

Offline

#4 2007-04-23 15:02:43

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [SOLVED] Timezones UTC and EDT all mixed up

TIMEZONE="Eastern US" is not a valid value. Use "America/New_York"


1000

Offline

#5 2007-04-23 15:04:00

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: [SOLVED] Timezones UTC and EDT all mixed up

the problem is that windows screws everything up by saving the local time on your machine. iirc, i think the deal is that you have to set the time correctly in windows and the BIOS, then in linux set your hardware clock function to the local time with one of the hwclock commands, forget which one it is, either hwclock --hctosys  or hwclock --systohc (check hwclock --help or man hwclock). messing around with those will usually do it, i just haven't done it in a long time because i don't dual boot anymore except on my laptop, and solved this windoze problem there a long time ago.

Offline

#6 2007-04-23 18:46:16

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: [SOLVED] Timezones UTC and EDT all mixed up

byte wrote:

TIMEZONE="Eastern US" is not a valid value. Use "America/New_York"

Or use the correct format of TIMEZONE="US/Eastern".

Offline

#7 2007-04-23 18:49:15

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: [SOLVED] Timezones UTC and EDT all mixed up

toofishes wrote:
byte wrote:

TIMEZONE="Eastern US" is not a valid value. Use "America/New_York"

Or use the correct format of TIMEZONE="US/Eastern".

or that might help. big_smile

Offline

#8 2007-04-23 19:48:19

RobF
Member
Registered: 2006-10-10
Posts: 157

Re: [SOLVED] Timezones UTC and EDT all mixed up

I'll be damned.  The problem was resolved by applying byte's suggestion to replace TIMEZONE="Eastern US" with TIMEZONE="America/New_York".

At first I was incredulous that this worked because I thought I'd never touched the TIMEZONE="..." entry in rc.conf and whatever was there had been put there during the initial Arch install.  But it is possible that I did put the "Eastern US" parameter in there in an attempt to fix this problem, perhaps being misled by the highlighted item in the KDE Control Center "Date & Time Module" that says "New York   America/US   Eastern Time" (although underneath that box it now says "Current local timezone: America/New York (EDT)".  Or perhaps I was misled by some database file that I found in Arch that listed all legal timezone entries, and I thought I'd seen "Eastern US" listed there.

In any case, everything appears to be in good order now, i.e. the settings are as follows (without my having to do anything aside from resetting the TIMEZONE in rc.conf):

1. BIOS "system date and time" is set to the local time, i.e. EDT time
2. Windows XP taskbar clock shows correct EDT time and so does the DOS "time" command
3. In Arch, the clock in the login box, the screensaver clock and the digital clock in the bottom panel all show the correct EDT time, and the "date" and "hwclock" commands also give the correct time and indicate that it's EDT.  Also, timestamps on files are correct now.

The only peculiarity I came across was the fact that after I changed TIMEZONE and restarted Arch, then went into the BIOS and then into Windows, followed by restarting Arch (all of these being WARM restarts, not complete reboots), the "hwclock" command displayed the time 4 hours ahead of the correct time (i.e. showing UTC time) and said that it was EDT.  This remaining disparity was resolved by a hard reboot (i.e. a complete reboot).

I'll also try TIMEZONE="US/Eastern", in case that is the standard designation for my timezone.  If you don't hear from me again, assume that this setting also worked.

Thanks to everybody!

Offline

#9 2007-04-23 20:31:37

RobF
Member
Registered: 2006-10-10
Posts: 157

Re: [SOLVED] Timezones UTC and EDT all mixed up

TIMEZONE="US/Eastern" also seems to work in rc.conf, although after a warm and a cold reboot, the file /etc/timezone still reads:

America/New_York

So perhaps the latter is the most standard designation of my timezone.

Offline

#10 2007-11-07 15:07:30

daedalus
Member
From: Mountain View
Registered: 2007-09-28
Posts: 50
Website

Re: [SOLVED] Timezones UTC and EDT all mixed up

I was having the same problem, and "America/New_York" just solved it for me.  Strange that it was never an issue in the past.

Offline

Board footer

Powered by FluxBB