Search code examples
getsettaskbarsystemtime

GetSystemTime and taskbarTime not matched


I want to change SystemTime in C#. I used SetSystemTime() and changed the System Date and Time successfully, but after changing it ,in task bar, only date is changed and task bar time doesn't change at all.

And when I call GetSysemTime I can see date and time changes. how can i Read Taskbar Time programmatically?or In other words does taskbar time refer to systemTime? Help Please

Ideas?


Solution

  • The difference between the two times will be due to time zone settings.

    Check HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation and adjust your reading accordingly.