It’s definitely a good thing to have your system clock synch itself each time you reboot using a public NTP Timeserver. FreeBSD makes this a piece of cake.
First, you’ll want to make sure your timezone is set correctly. Check /usr/share/zoneinfo for the correct time zone file, and copy it to /etc/localtime. I.e.:
bash-2.05b# cp /usr/share/zoneinfo/zonefilehere /etc/localtime
Once you’ve done that, you will need to make sure your date and time are set within at least a few minutes of the current date and time. To do this, use the date command:
bash-2.05b# date 0408290000
The date is in YYMMDDHHMM format, the clock being a 24 hour and not 12 hour clock. To make sure the date looks correct before moving on, just type date in again:
bash-2.05b# date
Sun Aug 29 00:00:33 MDT 2004
Now that our timezone, date, and time are all set correctly, lets setup the NTP daemon to keep the system time synced-up.To do this, open /etc/rc.conf in your editor of choice, and add these lines:
ntpdate_enable="YES"
ntpdate_program="ntpdate"
ntpdate_flags="-b timeserver.org"
Replace timeserver.org with a server from a public NTP timeserver list which is near you (by number of network hops, not necessarily physical location). You’ll need to Google for a list of these yourself. Voila!
Why did I do this? Well, my last post said it was posted at 5 something AM.. and we all know I would never get up that early.










By Jakob Breivik Grimstveit December 30, 2004 - 12:35 am
Great. Just what I needed today. A colleague of mine had sent me an email 05:54, which I knew couldn’t be correct. And after checking with my ntp-server I figured it had to be a problem on my side. Thanks to you I got the info I needed to fix this (copy Oslo timezone file to /etc/localtime. Thanks!
By Brandon January 1, 2005 - 5:12 am
No problem– I’m glad this post helped you out! Mostly I blog this stuff so I can go back and look at it later when I forget something, but every now and then it helps someone else out too.
By anon February 8, 2008 - 2:56 pm
Thanks for this guide, it helped me.
By Michael Guy February 16, 2008 - 7:29 pm
That path is wrong for Free BSD, in /usr/share/zoneinfo/ you will not find any files. But you will find many directories that contain them. So select the directory (add that last directory on to the path given) and then copy the appropriate zone file to /etc. Most of the people who don’t know how to do date in Unix I assume are new and might may get frustrated when they find out you left a directory off of your path.
Michael Guy
By eugene December 11, 2009 - 3:42 am
Everything working properly, but I have one question: I have another linux server which also sinchronizes time with the same ntp-server as my freebsd server, but there are time mistmach (aprox. 3 minutes)… Is it normal and how is it possible at all?
P.S. my windows workstation shows the same time as linux-server…
By 2fuf February 22, 2010 - 5:57 am
@eugene: maybe the timezone description is screwed up in such a way that it is 3 mins off?
By Chad February 6, 2011 - 7:31 am
Mr. Harper – Your article states to copy the timezone file, but the actual command you pasted moves it, which you probably do not want to do.
By Brandon Harper January 4, 2012 - 7:36 am
Thanks Chad. Fixed.