Click here to Skip to main content
6,596,602 members and growing! (19,910 online)
Email Password   helpLost your password?
General Programming » Date and Time » General     Intermediate License: The Code Project Open License (CPOL)

How to synchronise your Windows 2000 machine using SNTP

By Rob Manderson

Using the Windows 2000 Time Service to set the system clock
C++Win2K, Visual Studio, Dev
Posted:6 Jan 2004
Views:68,430
Bookmarked:23 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
30 votes for this article.
Popularity: 6.24 Rating: 4.22 out of 5
1 vote, 3.4%
1

2
2 votes, 6.9%
3
6 votes, 20.7%
4
20 votes, 69.0%
5

Introduction

I used to run Atomic clock to keep my system time accurate. But after the last rebuild of this computer I didn't want to reinstall it. So I did a bit of poking around in MSDN and found the steps needed to let Windows 2000 synchronise itself to an internet time source using a service that's shipped as part of the operating system.

There's nothing earth-shattering in this little article - everything I present can be found in MSDN but I thought I'd write it up to save someone else the time needed to track it all down.

The primary source of information I used is the MicroSoft Knowledgebase article Q223184. (Clickety not provided because the URL's sometimes change).

Environment this article refers to

I've only tested this on Windows 2000 Professional, Service Pack 4.

Using the Windows 2000 time service

First you need to modify the following registry keys (or download the registry script at the top of this article and merge it into your registry).
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
"LocalNTP"=dword:00000000
"Period"="SpecialSkew"
"NtpServer"="india.colorado.edu"
"NTP"="NTP"
"Type"="NTP"
The LocalNTP entry determines whether this machine, having been synchronised to an external source, will act as an NTP server for your local network.

The Period entry determines how often your machine synchronises to an external time source. SpecialSkew is the default value which occurs once every 45 minutes until 3 good synchronizations occur, then once every 8 hours (3 per day)

The NtpServer entry can be either an IP address or a url. In either case it should refer to a machine running the SNTP protocol. You'll see here that I'm using a server at what I presume is Colorado University. I got the server name by doing a search on Google looking for public SNTP servers. There are hundreds of such servers out there. As an aside, in general the providers of public servers request that each site synchronise only one or two machines via the external server and synchronise other machines at the site from those one or two externally synchronised machines.

You can also set the NtpServer entry from a command prompt by executing the following command

net time /setsntp:india.colorado.edu
You can query the current NtpServer setting by executing this command
net time /querysntp
which will display the current server name (or IP).

The Type entry is used to specify whether the time service synchronises to the domain controller, to an external source, or doesn't synchronise at all.

Once you've set the registry entries you need to set the time service to run automatically upon boot. The service is called Windows Time in the services applet. On Windows 2000 Professional systems the service is installed but set to manual start. Set your clock to some wildly wrong value, start the service and the clock should change to indicate the machine is now synchronised to the external time source you specified.

That's it

I hope this little article comes in useful for someone out there.

History

January 7, 2004 - Initial version.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Rob Manderson


Member
I've been programming for 31 years - started in machine language on the National Semiconductor SC/MP chip, moved via the 8080 to the Z80 - graduated through HP Rocky Mountain Basic and HPL - then to C and C++.

I used (20 or so years ago when I worked for Hewlett Packard) to repair HP Oscilloscopes and Spectrum Analysers - for a while there I was the one repairing DC to daylight SpecAns in the Asia Pacific area.

Afterward I was the fourth team member added to the Australia Post EPOS project at Unisys Australia. We grew to become an A$400 million project. I wrote a few device drivers for the project under Microsoft OS/2 v 1.3 - did hardware qualification and was part of the rollout team dealing directly with the customer.

Born and bred in Melbourne Australia, now living in Scottsdale Arizona USA, became a US Citizen on September 29th, 2006.

I work for a medical insurance broker, learning how to create ASP.NET websites in VB.Net and C#. It's all good.

I'm now getting seriously into composing music - partway through writing a symphony.

Oh, I'm also a Kentucky Colonel. http://www.kycolonels.org
Occupation: Software Developer (Senior)
Location: United States United States

Other popular Date and Time articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 5 of 5 (Total in Forum: 5) (Refresh)FirstPrevNext
GeneralThanks! PinsussAnonymous7:39 1 Oct '04  
GeneralSync SNTP time once only Pinmembermcpata200218:12 20 Jun '04  
GeneralWin 2000 time PinmemberGordon Moore7:21 14 Jan '04  
GeneralRe: Win 2000 time PineditorRob Manderson0:07 20 Jan '04  
Generalgood find PinmemberJubjub13:26 7 Jan '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 6 Jan 2004
Editor: Rob Manderson
Copyright 2004 by Rob Manderson
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project