# Time on FreeBSD Server off



## ppvora (Sep 27, 2013)

Hello all,

I hate to bring this up again (there are threads on this, but they don't solve my problem) but here's my problem: I have a FreeBSD VPS that just won't have the right time. When I run the `date` command it displays: 
	
	



```
Fri Sep 27 17:12:11 EDT 2013
```

The date is correct, the time zone (EDT) is correct, but the time is way off. As the time the `date` command was run, the EDT time was 13:21:xx  --- I ran the tzsetup utility and made all the right selections (as confirmed by the EDT output from `date`). I rebooted the server. I also ran `ntpd -q`.

No luck. Help.
-Premal


----------



## wblock@ (Sep 27, 2013)

Is ntpd(8) enabled?  If not, does it set the time correctly if you run `ntpd -x -q`?  Virtual machines often have trouble keeping time, usually helped by adding 
	
	



```
kern.hz="100"
```
 to /boot/loader.conf and corrected by running ntpd(8) as a daemon.


----------



## ppvora (Sep 27, 2013)

@wblock@,

Thanks.

 When `ntpd -x -q` is run, the time is not corrected.
 Once I added 
	
	



```
kern.hz="100"
```
 to the loader.conf file and then I run ntpd as a daemon, the time was corrected!  Hooray!
-Premal


----------



## jalla (Sep 27, 2013)

See ntpd(8)(). If time is more than 1000s off you need -g as well
`ntpd -x -q -g`


----------



## wblock@ (Sep 27, 2013)

The /etc/rc.conf version is:

```
ntpd_enable="YES"
ntpd_sync_on_start="YES"
```


----------

