PDA

View Full Version : detect system time change



ahmdsd_ostora
24th June 2010, 13:15
I want to detect the event when the system clock changes. I am working on windows.
If there is not any way in Qt, please guide me where to find a way

high_flyer
24th June 2010, 13:22
I don't if there is such an event.
But what you can do, is have a timer call a slot every half a second and get the system time.
If the time has changed in more then one second, you know someone has changed the system time.

ahmdsd_ostora
24th June 2010, 13:58
thank u alot
this will be my last choice
any more intelligent way ?

squidge
24th June 2010, 16:30
Sure, but the more intelligent ways will add a lot of OS-specific code to your project. By far the easiest to implement and least OS-specific way is to just query the time once a second and check yourself.

ahmdsd_ostora
24th June 2010, 18:53
thank u both , I will do it

sherifomran
29th October 2019, 12:04
there is an event in linux when the time changes using external sources or an app, see this link, may be there is something similar in windows
https://lkml.org/lkml/2010/9/16/405