[commit] r2400 - Merging support files from cogvm branch.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2400 - Merging support files from cogvm branch.

commits-3
 
Author: andreas
Date: 2011-06-08 23:56:44 -0700 (Wed, 08 Jun 2011)
New Revision: 2400

Modified:
   trunk/platforms/win32/plugins/LocalePlugin/sqWin32Locale.c
Log:
Merging support files from cogvm branch.

Modified: trunk/platforms/win32/plugins/LocalePlugin/sqWin32Locale.c
===================================================================
--- trunk/platforms/win32/plugins/LocalePlugin/sqWin32Locale.c 2011-06-09 06:53:42 UTC (rev 2399)
+++ trunk/platforms/win32/plugins/LocalePlugin/sqWin32Locale.c 2011-06-09 06:56:44 UTC (rev 2400)
@@ -122,17 +122,23 @@
 }
 
 sqInt sqLocGetTimezoneOffset(void) {
- TIME_ZONE_INFORMATION timeZoneInformation;
- GetTimeZoneInformation(&timeZoneInformation);
- return -(timeZoneInformation.Bias+timeZoneInformation.DaylightBias);
+  DWORD tzid;
+  TIME_ZONE_INFORMATION timeZoneInformation;
+  tzid = GetTimeZoneInformation(&timeZoneInformation);
+
+  if(tzid == 1) /* TIME_ZONE_ID_STANDARD */
+    return -(timeZoneInformation.Bias+timeZoneInformation.StandardBias);
+
+  if(tzid == 2) /* TIME_ZONE_ID_DAYLIGHT */
+    return -(timeZoneInformation.Bias+timeZoneInformation.DaylightBias);
+
+  return -timeZoneInformation.Bias;
 }
 
 /* return true if DST is in use, false otherwise */
 sqInt sqLocDaylightSavings(void) {
- TIME_ZONE_INFORMATION timeZoneInformation;
- GetTimeZoneInformation(&timeZoneInformation);
- if(timeZoneInformation.DaylightBias == 0) return 0;
- return 1;
+  TIME_ZONE_INFORMATION timeZoneInformation;
+  return GetTimeZoneInformation(&timeZoneInformation) == 2;
 }
 
 static char longDateFormat[] = "dddd dd mmmm yy";