comparison src/util.c @ 10987:a8a7730db73c

[gaim-migrate @ 12824] Fix win32 timezone suckage. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 09 Jun 2005 04:03:20 +0000
parents 747ef488c600
children 719779387f96
comparison
equal deleted inserted replaced
10986:ecc0f22db510 10987:a8a7730db73c
554 } 554 }
555 555
556 t->tm_isdst = -1; 556 t->tm_isdst = -1;
557 557
558 if (tzoff || utc) { 558 if (tzoff || utc) {
559 #ifdef _WIN32
560 TIME_ZONE_INFORMATION tzi;
561 DWORD ret;
562 if ((ret = GetTimeZoneInformation(&tzi))
563 != TIME_ZONE_ID_INVALID) {
564 tzoff -= tzi.Bias * 60;
565 if (ret == TIME_ZONE_ID_DAYLIGHT) {
566 tzoff -= tzi.DaylightBias * 60;
567 }
568 }
569 #else
559 #ifdef HAVE_TM_GMTOFF 570 #ifdef HAVE_TM_GMTOFF
560 tzoff += t->tm_gmtoff; 571 tzoff += t->tm_gmtoff;
561 #else 572 #else
562 # ifdef HAVE_TIMEZONE 573 # ifdef HAVE_TIMEZONE
563 tzset(); /* making sure */ 574 tzset(); /* making sure */
564 tzoff -= timezone; 575 tzoff -= timezone;
565 t->tm_isdst = 0; /* I think this might fix it */ 576 t->tm_isdst = 0; /* I think this might fix it */
566 # endif 577 # endif
567 #endif 578 #endif
579 #endif /* _WIN32 */
568 } 580 }
569 } 581 }
570 } 582 }
571 583
572 retval = mktime(t); 584 retval = mktime(t);