Thursday, October 1, 2015

NetTime


NetTime
NetTime is a Simple Network Time Protocol (SNTP) client for Windows 95/98/Me/NT/2000/XP/Vista/7/8 and Server 2003/2008/2012. (32 bit and 64 bit operating systems are both supported)
If you're looking for a program to keep your system time accurate, you've just found it!
Its main attributes are:
  • Free
  • Open Source
  • Small
  • Easy to Install and Use
  • And most importantly: Reliable
NetTime was originally written by Graham Mainwaring in 1997 with an open source release made in 1998. Graham made a number of updates to the program until he lost interest and finally abandoned the project officially on the 1st of July 2004.
The NetTime project has been resurrected by myself, Mark Griffiths, and I'm now making an updated version available here:
If you find NetTime useful, please consider making a donation to show your appreciation and to encourage further development of NetTime!


Download:

Version 3.14 - Current Stable Version:
Version 3.20 Alpha 1:
Previous versions as well as the source code can be downloaded from the SourceForge project page
Note: When upgrading from a previous version, you will need to shut down both the NetTime Service as well as the Tray Icon before running the installer. If you uninstall the old version first, you will need to restart your computer before starting the new installer.

Configuration Notes:

Most settings should be fairly self explanatory, however some people have asked for clarification on certain settings:
Max Free Run: Indicates how long the program will run for without getting a valid sync befores it considers the local time to no longer be accurate. Once this time period expires, the tray icon will change to a cross and if it's configured to act as a time server, it will stop responding to requests for the time.
If Time adjustment greater than: The default setting for this means that the local time will be updated regardless of how much difference there is between the current local time and the time reported by the remote server. There shouldn't normally be a reason to change this as the current version of NetTime will check with multiple servers to ensure that it isn't using an invalid time.
If you are using NetTime to act as a time server, you will need to disable the built in Time Service in Windows first. Although the description for the Windows Time Service indicates that disabling it may prevent other services from loading, I'm not currently aware of any such services that do actually require it. If you're not using NetTime as a time server, disabling the Windows Time Service is optional, but there shouldn't be any harm in disabling it to save a bit of RAM.

Notes for Administrators:

You can quickly install the client by running the above installer with either the /silent or /verysilent command line switches.
If you want to preconfigure settings that are different to the defaults, they are stored in the registry under:
HKLM\Software\Subjective Software\NetTime
On 64 bit systems, the above location is remapped to:
HKLM\Software\Wow6432Node\Subjective Software\NetTime

Improvements made with this version include:

Version 3.20 Alpha 1:
  • Added option to gradually correct small time errors instead of adjusting the time in one hit - thanks to code provided by Julien Blitte
  • Added log file rotation - also thanks to Julien Blitte.
  • Fixed a problem with high CPU usage when a lot of logging activity taking place.
  • A few other minor improvements.
Version 3.14:
  • Improved compatibility with other NTP/SNTP clients when NetTime is acting as a server - e.g. Windows built in time client.
  • Added extra logging information.
  • Fixed an error which could sometimes occur when installing over the top of a previous version.
  • Fixed a problem preventing full uninstallation under certain circumstances.
  • Removed requirement to manually shut down NetTime before installing a new version. (Windows restart may be required sometimes due to above bug)
  • Improved handling when service is disabled & UAC disabled.
  • Added code to re-show tray icon after Windows Explorer crashes.
  • A few other minor improvements.
Version 3.13:
  • Fixed an error that caused the program to always check for updates when run as a limited user.
Version 3.12:
  • Fixed an Access Violation error.
Version 3.11:
  • Added a workaround for a VCL bug which could prevent the NetTime service from being installed properly in very rare circumstances.
Version 3.1:
  • Fixed a problem with running on Windows NT4.
  • Added a balloon tip to the tray icon when run after installation to indicate that NetTime is running.
  • When set to not change time on large adjustment, will now ask user when doing a manual check.
  • Some changes to improve compatibility with newer versions of Delphi - notes added about upgrading to newer version of the Internet Component Suite.
  • Added option to always provide time when acting as a server.
Version 3.0:
  • Version Number Change only
Version 3.0 Release Candidate 1:
  • No significant changes since Beta 4
Version 3.0 Beta 4:
  • Fixed a few more bugs introduced with Beta 2
Version 3.0 Beta 3:
  • Fixed a few bugs introduced with Beta 2
Version 3.0 Beta 2:
  • Added capability to automatically check for new versions
  • Added button to view log within NetTime
  • Intervals can now be entered with units instead of only as a number of seconds
  • Added support for Windows Themes
  • Added option to quit if time adjustment is larger than a set value
  • Added command line option to sync only once and then exit (/updateonce)
  • Added command line option to only attempt syncing once and exit regardless of success (/tryonce)
Version 3.0 Beta 1:
  • Various UI fixes and improvements
  • Added default servers - thanks to the NTP Pool Project
  • Added support for the Network Time Protocol "Kiss of Death" packet
  • Added automatic syncing on additional triggers - e.g. resuming from suspend, time jumping forward or backwards
  • Added logging capability
  • Added extra information to the UI to show more details such as the time to the next sync, adjustment for the last sync and offsets and lag for each server queried
  • Changed server query method to minimize server loads - it now queries only a single server, unless it finds a time difference of greater than 10 seconds, in which case it will check with an alternate server to ensure that an invalid time isn't used
  • Improved handling of UAC - User Account Control - under Windows Vista & 7
  • Dropped Windows 95 pseudo service - Can still be used under Windows 98/98/Me as a regular application however
  • Removed automatic configuration screens for searching for available servers - not needed with the NTP Pool default servers
  • Fixed several UI problems
  • Fixed problems with running the client under limited user accounts in conjunction with the NetTime Windows Service
  • Various other minor fixes and improvements
Despite the amount of work that has gone into this updated version, most of the credit for it still lies with Graham Mainwaring.

Source Notes:

The latest version of NetTime was compiled and tested with Borland Delphi 7 Professional. Earlier versions have also been tested to compile successfully with the Personal Edition of Delphi 7 - if you would like to get into Delphi and make changes to NetTime, you might be able to still find a copy of Delphi 7 Personal Edition that you can download if you do enough searching. Alternatively, you can try using the latest trial version of Delphi available from Embarcadero.
The latest version has been tested with Delphi XE2 Professional: The current version includes an older version of the Internet Component Suite which is not compatible with Unicode versions of Delphi (i.e. Delphi 2009 and newer) Upgrading to the latest version of the Internet Component Suite by François Piette will resolve the Unicode issues. When upgrading to the new version of the Internet Component Suite, you will need to change the reference to HttpProt in the uses clause of UpdateCheck.pas to read OverbyteIcsHttpProt.

Contact me:

If you discover any problems with this version or would like to make a suggestion, please contact me: mark@timesynctool.com
Of course, as this is free software, I can't give any guarantees as to when (or even if) any feature requests will be incorporated into a future version - unless you're wanting to pay for it of course! If you have a programming project that you would like me to work on for you, you're certainly more than welcome to contact me!

Accuracy Notes:

NetTime, like most SNTP clients, will generally sync your system time to within 100 milliseconds of the correct time - often within 10 milliseconds. Of course, the accuracy is highly dependant on the accuracy of the server that it is connecting to - This updated version of NetTime has improvements included to try to ensure that even a badly inaccurate time server won't put the system time out - more information about this is included under History & Other Notes at the bottom. Asymmetric latency (Network delay which takes longer one way than the other) can also have an adverse impact on time accuracy.
SNTP clients resync the system time at regular intervals - between these time syncs, the system will be allowed to run at it's normal speed which may mean that it runs either fast or slow - gradually putting the system time out until the next sync takes place. The speed at which the system time deviates from the correct time depends greatly on the system hardware and also to a certain extent what software is being run. Most PCs gain or lose a few seconds each day, however I've seen a system that loses 9 seconds per hour - more than 3.5 minutes per day!
The vast majority of users should find that NetTime more than meets their needs, however if you have specific requirements for very accurate time, I recommend that you investigate installing a full NTP client. Although you can set NetTime to sync more frequently to compensate for an inaccurate system clock, this isn't really recommended because of the greater strain that it puts onto the public NTP servers. A full NTP client has extra features to ensure better time accuracy (normally well below 10 milliseconds even between time syncs) by adjusting the rate that the system clock runs at. If you are administering a large number of PCs for an organization, it's also recommended that you configure a full NTP client on your network and have the rest of your systems sync to it with an SNTP client - this reduces the load on the public time servers even further as well as ensuring that all systems are in sync with a single time source.

History & Other Notes:

Part of the apparent reason why Graham abandoned the NetTime project was because Windows 2000 and XP already include an SNTP Client and a free download was available from Microsoft for Windows NT. Graham characterized the Microsoft NTP client as being full featured, however, I strongly disagree with this - I would call the Windows SNTP client very basic - the user interface has only 2 features - allowing the SNTP server to be changed and a button to attempt an immediate sync. The Microsoft SNTP client does have more features available, but they require manual editing of the system registry - something which most users are understandably reluctant to do. In the end, even with editing the registry settings, the Microsoft client is still just an SNTP client with the limitation of being able to sync with only a single remote server.
Like the vast majority of SNTP clients that can only sync with one server, (and also most of the remainder that only have backups for if the primary server fails completely) the Microsft SNTP client has a major problem when it receives a reply with a vastly different time to what is currently set on the system - the software simply has no way to know which is closer to being correct - either the system time could be wildly inaccurate (e.g. because the CMOS battery has failed) or the answer from the server could be wrong (either accidentally or maliciously.)
For Windows XP, in order to prevent the Microsoft SNTP client from setting the system time to a wildly incorrect value, Microsoft made the design decision that their client would only update the system time if the server response was within 15 hours of the current system time. This reduced the risk of an invalid time being set on the system (but not completely) but also has the effect that if the system time isn't at least reasonably accurate it never would be until manually fixed! For a system with a failed CMOS battery, the Microsoft SNTP client is pretty much useless.
For Windows Vista (and 7) Microsoft relaxed the rules so that (at least when manually triggering an update) the current system time being wrong doesn't prevent the SNTP client from updating the system time. This of course does mean that an incorrect response from the time server can put the system time way out. The Windows Time Service in Windows 7 is also configured by default to not start automatically each time the system is started - the user interface reports that Windows is configured to automatically update the system time, but it doesn't unless the user manually starts the Windows Time Service either through the Services Control Panel applet, or by requesting a manual sync. Unless the user reconfigures the Windows Time Service to start automatically, it will be effectively disabled every time the system is restarted!
NetTime ensures that it is not setting the system time to an incorrect value by always checking with a second server (when configured) if the time adjustment is more than 10 seconds. Short of a major bug in the program design or a very sustained attempt to maliciously skew the system time by a rogue time server, NetTime simply won't set an invalid system time!

Links:

You might also be interested in:
FlexiRoster - Flexible Rostering Software
UltraSmartCharger - Open Source Charger/Analyzer for NiMH/NiCd/NiZn Batteries
GPing - Graphical Ping
POP3Filter - An Advanced Bayesian Spam Filter

http://www.timesynctool.com/