How to Get Windows 7 to Synchronize the Time at a Custom Interval of Your Choosing

Out of the box, Windows 7 synchronizes the system clock with time.windows.com every night at 1:00 a.m. †

The actual synchronization with the NTP server is performed by the Windows Time service (W32Time). Windows Time has two modes of operation:

  1. Start on demand, synchronize the clock, and stop, or
  2. run 24/7 and keep the clock synchronized automatically.

Number one is the default behavior on a standard installation of Windows 7. Rather than run at all times, Windows Time has a startup type of Manual, and every night at 1 a.m. the system starts the service, synchronizes the clock, and stops the service. This is accomplished with a scheduled task. In other words, the scheduling is left to the Task Scheduler service rather than the Windows Time service.

† This article applies to stand-alone, non-domain-joined Windows 7 installs.

Setting the Update Interval

If once a day at 1 a.m. isn’t good enough of an update interval for you, Windows 7 can be set to synchronize the clock with a frequency of your choosing. You can either preserve the default mode of operation and change when and how often the scheduled task runs, or drop the Task Scheduler approach in favor of the scheduling built into the Windows Time service.

Option #1: Using the Task Scheduler Service (Default)

Pros: No need to run an extra service; changing the update interval is easier.

Cons: Since the Windows Time service is stopped, when you look in the Internet Time tab of the Date and Time dialog box, you won’t see when the last successful synchronization occurred or when the next synchronization will take place. Instead, you’ll see “This computer is set to automatically synchronize on a scheduled basis.” You can use the Event Viewer (eventvwr.msc) to find out when the clock was last synchronized.

  • Run taskschd.msc.
  • Open the Task Scheduler Library\Microsoft\Windows\Time Synchronization folder.
  • Select the SynchronizeTime task and go to Properties.
  • If you’re feeling curious, check out the Actions tab. The task_started parameter passed to W32Time instructs the service to start, synchronize the clock, and stop immediately.
  • Select the Triggers tab.
  • Modify the schedule to your liking.

Option #2: Using the Windows Time Service

Pros: When you look in the Internet Time tab of the Date and Time dialog box, you will see when the last successful synchronization occurred (“The clock was successfully synchronized with <server> on <date> at <time>.”) and when the next synchronization will take place (“Next synchronization: <date> at <time>.”).

Cons: Running the Windows Time service 24/7 takes up extra memory; changing the update interval involves modifying the registry.

  • Run taskschd.msc.
  • Open the Task Scheduler Library\Microsoft\Windows\Time Synchronization folder.
  • Disable the SynchronizeTime task.
  • Run regedit.exe.
  • Open the HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\W32Time\TimeProvider\NtpClient key.
  • Set SpecialPollInterval to the desired update interval, in seconds.
  • Run services.msc.
  • Select the Windows Time service.
  • Set Startup Type to Automatic.
  • Start the service.

Using a Better Time Server

time.windows.com, Microsoft’s time server, has often been found to be inaccurate and/or unresponsive. For increased reliability, you may want to use a third-party NTP server.

For a list of public time server pools in your area, see http://support.ntp.org/bin/view/Servers/NTPPoolServers.

8 thoughts on “How to Get Windows 7 to Synchronize the Time at a Custom Interval of Your Choosing”

  1. Hans,

    To have the task run multiple times a day, use a daily trigger in combination with the repeat feature under Advanced settings. For example, to program the task to run every eight hours:

    * Under Settings, select Daily.
    * Under Advanced settings, enter Repeat task every 8 hours for a duration of Indefinitely.

    Thanks for your comment! I hope this helps.

    Nick

  2. After disabling the scheduled task, here is how to do the rest from the command line:

    :: Set this to the NTP server(s) you want to use.
    SET NTPSERVERS=time.my-file-server.tld,0x1 time.ntp.org,0x1
    SET UpdateIntervalSeconds=7200

    w32tm /register
    net start w32time
    reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d %UpdateIntervalSeconds% /f
    reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters /v NtpServer /d "%NTPSERVERS%" /f
    :: Normally already the default, but just in case:
    reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters /v Type /d "NTP" /f
    w32tm /config /update

    w32tm /resync
    w32tm /query /status

  3. You can use the following to disable the task from the command line: schtasks /Change /TN “\Microsoft\Windows\Time Synchronization\SynchronizeTime” /DISABLE

Leave a Reply

Your email address will not be published. Required fields are marked *