none
GetTImeZoneInformation cannot return correct StandardName RRS feed

  • Question

  • I am using the Windows API GetTImeZoneInformation to get the memeber StandardName of TIME_ZONE_INFORMATION, but it seems not correct for some time zone.

    For example, The current time zone of OS is set to (UTC-07:00) Arizona, then I call this function but StandardName returns "US Mountain Standard Time". Is it correct? How does it return the correct name like "Arizona"?

    In additional, if the timezone of OS is set to (UTC-07:00) Mountain Time (US & Canada), StandardName returns "Mountain Standard Time"

    Thanks.

    Tuesday, June 5, 2012 9:56 AM

Answers

  • Hi Jason_LYS,

    Based on my understanding, after reproducing the scenario, I have the same doubt, so I do some research. The Windows API GetTImeZoneInformation() is right, and your thought is right, too: the US Mountain Standard Timestands for Arizona.

    We can go to the regedit, in “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time”, get Arizona in DIspaly.

    Here is my understanding of why Mountain Standard Timestands for Arizona:

    You know the United States uses nine standard time zones: Atlantic Standard Time (AST), Eastern Standard Time (EST), Central Standard Time (CST), Mountain Standard Time (MST), and so forth.  And Arizona is in MST zero. Daylight Saving Time begins at 2:00 a.m. local time on the second Sunday in March. On the first Sunday in November areas on Daylight Saving Time return to Standard Time at 2:00 a.m. And Arizona does not observe Daylight Saving Time.

    So that is why, now June, you select Arizona, the function return Mountain Standard Time, not Mountain Daylight Time, and Mountain Daylight Time for (UTC-07:00) Mountain Time (US & Canada).

    I hope it will help you.

    Regards,

    Elegentin

    Wednesday, June 6, 2012 8:27 AM
    Moderator