# Trouble with my clock

## Phenomic69

I usually sync to time.nist.gov once every few days. I am dual booting windows and I usually have it sync to the same server.  I am in Eastern Time in the US.  My problem is that whenever I sync in one operating system, the other operating system is 4 hours off.  I made a link in my install to put in the correct timezone, I also pciked the right one in windows.  Is there any way I can get my time to be right in both operating systems without affecting each other.  I think it has something to do with how they report to the hardware clock.

----------

## ctford0

make sure you have local time set in your rc.conf file.

chris

----------

## hensan

And if that doesn't help, try deleting the file /etc/adjtime, this was causing problems for me.

[edit]

After deleting the file, sync time again and do a hwclock -w

[/edit]

----------

## goanuj

how does one sync? is there a howto for this?

----------

## Phenomic69

You need ntptools:

## emerge ntptools

and then i usually just do this command:

## ntpdate time.nist.gov

and as the previous post states, if you want to set your hardware clock to this value do a:

## hwclock -w

----------

## goanuj

does ntpdate sync the time in the background or is it just a one time thing?

(I would prefer a one time sync)

 *Phenomic69 wrote:*   

> 
> 
> ## ntpdate time.nist.gov
> 
> and as the previous post states, if you want to set your hardware clock to this value do a:
> ...

 

----------

## ctford0

ntpdate is a one time deal, but pc clocks are awful about keeping time correctly.  there is also a dameon that comes with this called ntpd.  setting up ntpd will run ntp often enough to keep your system always uptodate...

chris

----------

## philip99

 *Phenomic69 wrote:*   

> ## ntpdate time.nist.gov
> 
> 

 

Actually... time.nist.gov is not considered open for public... Have a look at the official ntp daemon site: http://www.eecis.udel.edu/%7emills/ntp/servers.html (bottom; under stratum1 servers) .. It states that time.nist.gov is open for stratum2 serveres only (+ ppl with an arrangement)

Not that ppl give a damn anyway  :Wink: 

----------

## puke

 *Quote:*   

> there is also a dameon that comes with this called ntpd.

 

ntpdate is a ntp client that connects to a ntp server.   ntpd is a ntp server that listens for ntp client connections.  

In the interests of security you should not use ntpd unless absolutely necessary.  Most installations can get away with running ntpdate at regular intervals.  Leave time serving up to the time servers!   :Wink: 

You can also list multiple time servers with ntpdate eg:

```
ntpdate time1.edu time2.edu time3.edu
```

and get a result that is the best of all three.  Also helps if one goes down.

----------

## hulk2nd

there is a very good ntpd howto somewhere on this board. try searching for it

----------

## ctford0

 *puke wrote:*   

>  *Quote:*   there is also a dameon that comes with this called ntpd. 
> 
> ntpdate is a ntp client that connects to a ntp server.   ntpd is a ntp server that listens for ntp client connections.  
> 
> In the interests of security you should not use ntpd unless absolutely necessary.  Most installations can get away with running ntpdate at regular intervals.  Leave time serving up to the time servers!  
> ...

 

Take a look at man ntpd!!!!

 *Quote:*   

> 
> 
> DESCRIPTION
> 
>        The ntpd  program is an operating system daemon which sets and  maintains  the  system  time of day in synchronism with Internet standard time servers. It is a complete implementation  of  the  Network  Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305,  and  version  1  and  2,  as  defined  by RFC-1059 and RFC-1119, respectively.  ntpd  does most computations in 64-bit floating point arithmetic and does  relatively  clumsy 64-bit fixed  point  operations only when necessary to preserve the ultimate precision, about 232 picoseconds. While the  ultimate  precision,  is not  achievable  with ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs.
> ...

 

Although reading further it can act as a server, but it can operate in a number of different modes.

 *Quote:*   

> 
> 
> By default, ntpd  runs in continuous mode where each of possibly several  external servers is polled at intervals determined by an intricate  state  machine.
> 
> 

 

The manual suggests that ntpd can be processor intensive sometimes and might not be suited for workstations.  It suggests that if you can't afford a few clock cycles that you should setup a cron to run ntpdate.

Chris

----------

