Ticket #364: tz.patch

File tz.patch, 683 bytes (added by Didactylos, 17 years ago)

Timezone patch

  • client/hostinfo_win.C

     
    8989int get_timezone(int& timezone) {
    9090
    9191    TIME_ZONE_INFORMATION tzi;
     92        ZeroMemory(&tzi, sizeof(TIME_ZONE_INFORMATION));
    9293
    93         memset(&tzi, '\0', sizeof(TIME_ZONE_INFORMATION));
     94    DWORD result = GetTimeZoneInformation(&tzi);
    9495
    95     GetTimeZoneInformation(&tzi);
     96    if (result == TIME_ZONE_ID_DAYLIGHT) {
     97        timezone = -(tzi.DaylightBias * 60);
     98    } else {
     99        timezone = -(tzi.StandardBias * 60);
     100    }
    96101
    97     timezone = -(tzi.Bias * 60);
    98 
    99102    return 0;
    100103}
    101104