Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I would like to detect during my C# application run-time a manual change of the system time and date and automatic daylight savings time change.
Moreover I am looking for a way to detect these changes that happened during the time the application was offline when the user launched the application.
In this page http://support.microsoft.com/kb/815314 there is an explanation how to scan the events log but I couldn't find something that will identify an event uniquely as time change event.

Thanks in advance for your help,
Oren
Posted

1 solution

There is a SystemEvents.TimeChanged[^] event that is triggered when the user changes the time on the system clock.

When the program is not running, you can store the value in DateTime.Now.IsDaylightSavingTime and use this to compare at next startup.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 26-May-11 21:28pm    
Good, my 5.
--SA
Kim Togo 27-May-11 10:13am    
Thanks SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900