views:

36

answers:

1

Is there a windows API that would achieve the equivalent of cliking the "Update now" button in the "Date and time properties"/"Internet time" tab (opened by double clicking the clock in the taskbar)?

Is there a way to monitor when the time syncronization is trigered by windows and when it succeeds or fails?

+1  A: 

There is no API exposed by the time service, but to trigger a time synchronization you can use the w32tm command line tool.

In C/C++ you can do something like this:

include <process.h>

...

system("w32tm /resync /nowait");

Take a look at w32tm documentation for further options.

Frank Bollack
Not exactly what I needed, but better than nothing. Thanks!
Hrvoje Prgeša