# NTP question

## al3x

Whenever I run ntpdate [servername] to syncronize my clock, it always synchs an hour too early for my local time.  My /etc/localtime file is symlinked to the proper region for my local time.  What's the deal?

----------

## delta407

What's CLOCK set to in /etc/rc.conf?

----------

## Nitro

What timezone does date show?

```
nitro@flex nitro $ date

Thu Jul  4 18:37:36 CDT 2002
```

I'm in the central timezone (obviously).  :Smile: 

----------

## blarson

So... If it says that I'm using UTC... and I shouldn't be...  Any thoughts?

```
root@redfox blarson # date

Thu Nov 21 21:15:17 UTC 2002

```

```
root@redfox blarson # ls -l /etc/localtime

lrwxrwxrwx    1 root     root           30 Nov 21 21:05 /etc/localtime -> /usr/share/zoneinfo/US/Central

```

```
# 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".  This setting is used by the /etc/init.d/clock script.

CLOCK="local"

```

This just started happening a day or so ago... It should be in Central time, but is 6 hours fast instead.  It probably happened because I booted into windows (the root of all evil  :Wink: ) to play some warcraft

Thanks!

-Brad

----------

## jondkent

Silly question, but are you sync'ing to a NTP server in your timezone??

----------

## masseya

blarson - Thanks for searching.   :Smile: 

NTP servers always give you time in terms of UTC.  You are six hours ahead because Central time is UTC -6 hours.  I would just change your CLOCK variable to UTC and the system should use your timezone information to adjust the time by -6 hours. HTH..

----------

## guero61

 *Quote:*   

>  I would just change your CLOCK variable to UTC and the system should use your timezone information to adjust the time by -6 hours.
> 
> 

 

I would actually have to disagree with a Mod here...

My experience with NTP and system times is that you need CLOCK to say "local" and your /etc/localtime needs to point to your appropriate time zone.  At least, that's what's worked for me, but things seem to scarily work just right for me the first time.

----------

## masseya

 *guero61 wrote:*   

> I would actually have to disagree with a Mod here...

 

lol..  It's not that big of a deal.  I certainly hope people don't feel afraid to post when they have differing opinions.  I'll check my config when I get home and post what I have.

----------

## nikai

 *guero61 wrote:*   

> My experience with NTP and system times is that you need CLOCK to say "local"

 

I'm in favor of "UTC". My timezone is CET, and this is working nicely for me, especially including changes of daylight saving time.

The only problem I encountered with "UTC" was dualbooting with Windows, because Windows always assumed your hwclock was running at local time.

----------

## blarson

If possible, I would really like to keep my CLOCK set to local, because I use windows for games every once in a while.  Maybe I can set windows to use UTC... I'll have to look into that.

But anyways, that doesn't solve my problem... it doesn't matter what the clock is set to, NTP always puts it 6 hours off and date says I am using UTC.  I do have a sym link from /etc/localtime to my time file... I am thinking that my /usr/share/zoneinfo/US/Central file might be corrupt...  Can I emerge baselayout to get a fresh one?  or can someone post their /Central file?

Thanks for the help!

----------

## pjp

Moved from OTG.

----------

## masseya

In case anyone wants to know: 

```
# 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".  This setting is used by the /etc/init.d/clock script.

CLOCK="UTC"
```

```
bash $ date

Fri Nov 22 21:03:39 EST 2002
```

```
masseya@gandalf masseya $ ls -l /etc/localtime 

lrwxrwxrwx    1 root     root           40 Sep 20 12:37 /etc/localtime -> /usr/share/zoneinfo/America/Indianapolis
```

Don't know if that helps any of the dual booters out there, but I thought I would post what I have as a working sample in case anyone needed it.   :Smile: 

----------

## pjp

So, you dual-boot with UTC?  I was under the impression that with the UTC setting, time in MS Windows would be 1 hour off.  Has been for me anyway.  Perhaps I've chosen the wrong timezone for that option.

----------

