System time is the current date and time of day. Windows keeps system time so that your applications have ready access to accurate time. When Windows first starts, it sets the system time to a value based on the real-time clock of the computer and thereafter regularly updates the time.
Windows bases system time on coordinated universal time (UTC). UTC-based time is loosely defined as the current date and time of day in Greenwich, England. You can retrieve the system time by using the GetSystemTime function. GetSystemTime copies the time to a SYSTEMTIME structure that contains individual members for month, day, year, weekday, hour, minute, second, and milliseconds.
Because system time is UTC-based, the time copied to the SYSTEMTIME structure may not be the same as the local time ¾ the date and time of day for your time zone. You can retrieve the local time by using the GetLocalTime function. GetLocalTime converts the system time to a local time based on the current time-zone settings and copies the result to a SYSTEMTIME structure. To convert a UTC time stored in a SYSTEMTIME structure to a local time, use the SystemTimeToTzSpecificLocalTime function.
The current time-zone settings control how Windows converts between UTC and local time. You can retrieve the current time-zone settings by using the GetTimeZoneInformation function. The function copies the setting to a TIME_ZONE_INFORMATION structure and returns a value indicating whether local time is currently in standard or daylight-savings time. You can set the time-zone settings by using the SetTimeZoneInformation function.
You can set the system time by using the SetSystemTime or SetLocalTime function. SetSystemTime assumes you have specified a UTC-based time; SetLocalTime assumes local time and converts to UTC before setting the system time. If you change the system time, you should send the WM_TIMECHANGE message to all top-level windows by using the SendMessage function.
The GetSystemTimeAdjustment and SetSystemTimeAdjustment functions support algorithms that synchronize the time-of-day clock with another time source using a periodic time adjustment applied at each clock interrupt.