# Time -- EDT still one hour behind :( [SOLVED]

## mroconnor

OK, I have searched the forums, read the docs. I must still be missing something.

I can use 'date' and set my time only to watch it become an hour behind when I do something like:

```
/etc/init.d/ntp-client restart 
```

BIOS is set to the correct UTC time.

/etc/conf.d/clock looks like this:

```

cat /etc/conf.d/clock 

# /etc/conf.d/clock

# Set CLOCK to "UTC" if your system clock is set to UTC (also known as

# Greenwich Mean Time).  If your clock is set to the local time, then 

# set CLOCK to "local".  Note that if you dual boot with Windows, then 

# you should set it to "local".

CLOCK="UTC"

# Select the proper timezone.  For valid values, peek inside of the

# /usr/share/zoneinfo/ directory.  For example, some common values are

# "America/New_York" or "EST5EDT" or "Europe/Berlin".

TIMEZONE="America/New_York"

# If you wish to pass any other arguments to hwclock during bootup, 

# you may do so here.

CLOCK_OPTS=""

# If you want to set the Hardware Clock to the current System Time 

# during shutdown, then say "yes" here.

CLOCK_SYSTOHC="yes"

### ALPHA SPECIFIC OPTIONS ###

# If your alpha uses the SRM console, set this to "yes".

SRM="no"

# If your alpha uses the ARC console, set this to "yes".

ARC="no"

```

And this seems to be set correctly too(I just redid the link to be sure):

```

lrwxrwxrwx  1 root root          36 Mar 13 08:54 localtime -> /usr/share/zoneinfo/America/New_York
```

when I do 'date' it still says:

```
cosmo zoneinfo # date

Thu Mar 13 08:55:47 EST 2008

```

It doesn't list EDT just EST and it is still an hour behind. I dont dual boot, I have reemerged timezone-data a handful of times, that wasn't helpful. It is really making me cranky and I am sure it is something very simple I am missing. Thanks in advance to whomever points me in the right direction.

Cheers,

PLast edited by mroconnor on Mon Mar 17, 2008 2:58 pm; edited 1 time in total

----------

## John R. Graham

Try setting TIMEZONE to "EST5EDT" in "/etc/conf.d/clock".  Also note that the most current install instructions call for copying the appropriate "/usr/share/zoneinfo" file to "/etc/localtime", not that the symlink usually hurts anything.  So,  copy "/usr/share/zoneinfo/EST5EDT" to "/etc/localtime" (or make a symlink if you must).   :Wink: 

- John

----------

## mroconnor

going to give it a go. Will report back shortly. 

Time....ugh  :Wink: 

----------

## mroconnor

No dice! Still one hour behind. I copied EST5EDT to /etc/localtime and added EST5EDT to /etc/conf.d/clock. Rebooted and did 'date'.

I got this:

```
cosmo ~ # date

Thu Mar 13 09:42:29 EST 2008
```

It is currently 10:42 here.  :Sad:  Or is it? maybe the computer is telling me something.

Interesting thing here. I did a zdump and this is what I got:

```
cosmo ~ # zdump /etc/localtime 

/etc/localtime  Thu Mar 13 10:43:40 2008 EDT

cosmo ~ # zdump /etc/localtime 

/etc/localtime  Thu Mar 13 10:43:40 2008 EDT

cosmo ~ # date

Thu Mar 13 09:45:07 EST 2008

```

----------

## John R. Graham

I almost hate to ask but, when's the last time you did an "emerge --sync" followed by and "emerge -uDNv world"?  The rules for when Daylight Savings time started were changed about 18 months ago.    :Confused: 

My version of timezone data is:

```
vesta ~ # equery list -i timezone-data

[ Searching for package 'timezone-data' in all categories among: ]

 * installed packages

[I--] [  ] sys-libs/timezone-data-2007k (0)
```

Is that what you have?

Arg.  Correction:  That can't be right with the zdump output you're getting. Could you post the output of

```
# zdump /etc/localtime UTC
```

- John

----------

## mroconnor

This is what I have:

```

cosmo ~ # equery list -i timezone-data

[ Searching for package 'timezone-data' in all categories among: ]

 * installed packages

[I--] [ ~] sys-libs/timezone-data-2008a (0)

```

----------

## John R. Graham

Well then, just for grins, can you install the stable version as a test?

```
# emerge -1 =sys-libs/timezone-data-2007k
```

Might be a problem with the testing branch version.

- John

----------

## mroconnor

Ok I downgraded and rebooted. 

And I am back to square one 

```

date

Thu Mar 13 11:46:05 EST 2008

cosmo ~ # zdump /etc/localtime 

/etc/localtime  Thu Mar 13 12:46:24 2008 EDT

```

'date' still reports EST but at least the time is correct. 'zdump' reports EDT but an hour ahead of 'correct' EDT time. 

This just bugs me.   :Evil or Very Mad: 

----------

## toralf

 *john_r_graham wrote:*   

> Also note that the most current install instructions call for copying the appropriate "/usr/share/zoneinfo" file to "/etc/localtime"

 That's might be related to sth. like this https://bugs.kde.org/show_bug.cgi?id=103013

----------

## mroconnor

Thats interesting, although I use xfce but do have some kde stuff floating around. What I did was actually

```
cp /usr/share/zoneinfo/EST5EDT /etc/loacltime
```

So there is no symlink to disappear.

 :Sad: 

----------

## John R. Graham

 *toralf wrote:*   

> That's might be related to sth. like this https://bugs.kde.org/show_bug.cgi?id=103013

 No, it's because there exist system configurations where "/usr" is on a different volume from "/etc" and, during boot, the timezone data from "/etc/localtime" is used before the "/etc/fstab" mounts are performed.  If "/usr" and "/etc" are on the same volume, then it's actually nicer to have the symlink.  Gentoo has chosen a very conservative (and reliable) install approach.

- John

----------

## John R. Graham

 *progresso wrote:*   

> Ok I downgraded and rebooted. 
> 
> And I am back to square one 

 Do you have an old CLOCK entry in "/etc/rc.conf" that might be conflicting?

- John

----------

## albright

Old standby (might help  :Smile:  )

```
rm /etc/adjtime
```

set time with ntpdate, and then set the hardware clock

```
hwclock --systohc
```

----------

## mroconnor

OK....I'll try that this evening when I can hit an ntp server. 

Thanks for the advice.

cheers

----------

## JC99

You should have CLOCK="" set to "local" not "UTC"...

```
CLOCK="local"

TIMEZONE="America/New_York"

CLOCK_SYSTOHC="yes"

```

and leave all other options on default and it should work. Thats what I use and it works.

----------

## eccerr0r

If you only use linux on the machine, it's better to just store UTC in the RTC.

Another thing to make sure is see if your environment variable TZ is not set.

```
$ echo $TZ

$ unset TZ; date
```

++ on checking /etc/localtime is either symlinked or a copy of the correct timezone file.

----------

## pappy_mcfae

 *eccerr0r wrote:*   

> If you only use linux on the machine, it's better to just store UTC in the RTC.
> 
> Another thing to make sure is see if your environment variable TZ is not set.
> 
> ```
> ...

 

How so? When I had my server set for UTC, it always came up with "a file has a time stamp in the future" warnings during boot time. When I changed the setting to local, that problem went away. That tells me I got rid of a problem by changing the clock setting. And while that system does have a version of Windoze installed, the only time I boot to it is when I am doing recording work...which isn't often. 

So Windoze never whined about the time being out of sync. However, when I would go into CMOS the time was always wrong! As my tagline says, whatever works is right, and for me, setting the clock to "local" works.

Blessed be!

Pappy

----------

## mroconnor

Well the only thing that has worked(almost) is unsetting $TZ. I did that last evening and 'date' and 'zdump /etc/localtime'  both displayed the correct time and EDT not EST. But this AM when I checked the laptop it was back to displaying EST and time was again one hour behind. Some how TS was reset to EST. All I did was 

```
emerge --sync && emerge -pvuDN world
```

What would reset $TZ and I wonder if I set it to EDT will eliminate the issue.

----------

## John R. Graham

Look in "~/.bashrc", "~/.bash_profile", "/etc/profile", or, in desperation

```
cd /etc

grep -r "TZ=" *
```

- John

----------

## eccerr0r

 *pappy_mcfae wrote:*   

> How so? When I had my server set for UTC, it always came up with "a file has a time stamp in the future" warnings during boot time. When I changed the setting to local, that problem went away. That tells me I got rid of a problem by changing the clock setting. And while that system does have a version of Windoze installed, the only time I boot to it is when I am doing recording work...which isn't often. 
> 
> So Windoze never whined about the time being out of sync. However, when I would go into CMOS the time was always wrong! As my tagline says, whatever works is right, and for me, setting the clock to "local" works.
> 
> Blessed be!
> ...

 

The only reason for having RTC set for localtime is if you dual boot Windows on the machine.  If you get tons of "has time stamp in future" it's because you had a time fubar at some point and files really are in the future - you should fix those timestamps, not mess with your clock.  The timestamp check is to make sure all your config files are up to date.

----------

## pappy_mcfae

 *eccerr0r wrote:*   

> The only reason for having RTC set for localtime is if you dual boot Windows on the machine.  If you get tons of "has time stamp in future" it's because you had a time fubar at some point and files really are in the future - you should fix those timestamps, not mess with your clock.  The timestamp check is to make sure all your config files are up to date.

 

Whatever the reason, when it's set to local, that doesn't happen. I know it's not going to kill my computer, nor mess with my setup if I choose to set my clock to local, so that's exactly what I do...on three machines. 

I merely offer another option. I offer it because all the clocks on all of my Gentoo machines that were set to "local" and used ntp all reset themselves exactly at the same time. That tells me that, unlike the guy who posted the original thread, my systems are working properly. 

If it works for me, it might work for him. 

Oh, and FYI, Slackware sets its clock to local, as does Debian. It's all a preference.

Blessed be!

Pappy

----------

## eccerr0r

 *pappy_mcfae wrote:*   

> Whatever the reason, when it's set to local, that doesn't happen. I know it's not going to kill my computer, nor mess with my setup if I choose to set my clock to local, so that's exactly what I do...on three machines. 

 

Well, having it saved as local time is the correct choice since you do have Windows installed.  Since Windows is installed, it does its own DST management and will be utterly confused when you stick in UTC.  Since Slackware (which is based off of SLS) and Debian were intended to be installed as dual boot, localtime is the correct choice.

For single-boot Linux machines, you might well program UTC into your clock since Windows won't be there to mess it up.  This comes at an additional benefit that you'll never have to fall back or leap forward; provided your timezone-data is up to date, it'll be totally automatic.  Basically all you need to do is sync seconds once in a while to a timeserver and you'll be on time every time!

Oh... and for TZ hacking, make sure you check your local .profile / .login / .bash_login / .bash_profile /... whatever you use shell if your user account.  I have my sister's shell box in eastern time, but when I login, 'date' will show mountain time, where I live!  Also if you set TZ=EST5EDT it should automatically set your DST as long you're in eastern time in the US, so you don't have to keep on switching it twice a year.  Other options are CST6CDT MST7MDT PST8PDT for the contiguous US.

----------

## pappy_mcfae

I'm just curious as to why you are recommending that I "fix" my systems when there is nothing wrong with my setup. Perhaps it's just a matter of perception on my part, but if you will recall, I made this statement:  *Quote:*   

> I offer it because all the clocks on all of my Gentoo machines that were set to "local" and used ntp all reset themselves exactly at the same time. That tells me that, unlike the guy who posted the original thread, my systems are working properly. 

 

In other words, I am not the one with the problem here. I'd say that if all my clocks "sprang ahead" at the same time, while I watched them do it, things are working properly, at least as far as making the change to and from DST is concerned. 

Also, I know the delineation of Slackware, and Debian. I was first exposed to both in 1994. I also had both running on my systems before I decided to make the move to Gentoo. No need to preach to the choir on that point.

My point is that setting for "UTC" or for "local" is a personal preference. I offered my personal preference and settings since the originator of the thread was having problems with his. Since he was set to UTC, and had problems, I offered an alternative. I didn't ask for help in repairing what, in my case, isn't broken.

Blessed be!

Pappy

----------

## mroconnor

I finally solved this with everyones help and input, here is what I did:

- Double check BIOS time is set to UTC. Sorry local time just didn't work for me and not using windows I dont need it. 

- Double check that /etc/localtime was copied from /usr/share/zoneinfo/EST5EDT. I copied it, didn't do a 'ln -s'.

-Check your /etc/conf.d/clock. Mine looks like this:

```
cat /etc/conf.d/clock 

# /etc/conf.d/clock

CLOCK="UTC"

TIMEZONE="EST5EDT"

CLOCK_OPTS=""

CLOCK_SYSTOHC="yes"

SRM="no"

ARC="no"
```

- Then I needed to search out ALL the $TZ variables and make sure the are set to EST5EDT.  pappy_mcfae & john_r_graham were real helpful with this. A quick:

```
cd /etc && grep -r "TZ=" * 
```

 tells you where to look and what to change.

- I then did this:

```
  rm -rf /etc/adjtime && /etc/init.d/clock restart && ntpdate -b -u pool.ntp.org && hwclock --systohc
```

 everything worked and 'on time'(pun intended).

A quick reboot to check that everything was right and I am happy.

Thanks again to everyone!

Cheers,

P

----------

