9

I wish to do some testing on my local machine which requires me to put the date forward a year. So I can test some stuff in SQL Server (i've found it not possible to override the sql server time).

However because I'm connected to a domain, I believe this is causing the time to be reset to normal a few moments after I try to override it.

I understand that it's probably important for the local and domain time to be insync, but is it possible to temporarily block the clock from being reset?

Disconnecting from the network isn't an option, as I require an internet connection.

If there is a manual way to block the time reset what are the likely reprocutions? I don't want to screw anything up on the network :-)

4
  • 1
    Would disabling the Windows Time service be acceptable?
    – jscott
    Feb 2, 2012 at 17:55
  • yep disabling time service would do the trick..
    – Cold T
    Feb 2, 2012 at 17:57
  • Just be aware that if the SQL machine's time gets too far out of sync with the DCs, authentication will fail.
    – mfinni
    Feb 2, 2012 at 18:21
  • 3
    If you're doing this on virtual machine, make sure to disable Time synchronization on your host VM manager because none of the above suggestions will otherwise work.
    – Dejan
    Mar 28, 2015 at 8:50

3 Answers 3

16

Open the registry editor (regedit), navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

Find the REG_SZ value named Type. Edit the value to NoSync. Set it back to Nt5DS when you need to sync with the domain hierarchy again.

You can do this from the command line by calling

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters /v Type /d NoSync /f

or in PowerShell, with:

Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Parameters -Name "Type" -Value "NoSync"
2
  • 1
    Interestingly my type value Type was set to NTP. So perhaps it was actually a NTP server setting which I couldn't see due to a domain policy or something. Feb 3, 2012 at 10:16
  • In some domain configurations, you might want to set the Type to NTP and add a specific DC to your list of NTP Sources, eg. if you have no DC's in your Site, and want to specify a remote DC with better connectivity than you have with the PDC Emulator. Feb 3, 2012 at 15:30
10

Disable the Windows Time service or block the outbound port 123 on your local firewall.

0
-1

You can type this in the cmd terminal to stop the Windows Time Sync. It does what you needed in Window OS.

net stop w32time

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .