]> gitweb.factorcode.org Git - factor.git/blob - basis/calendar/windows/windows.factor
508cbb0a49596f6839bd65b60751097e85e1b443
[factor.git] / basis / calendar / windows / windows.factor
1 USING: calendar namespaces alien.c-types system windows
2 windows.kernel32 kernel math combinators ;
3 IN: calendar.windows
4
5 M: windows gmt-offset ( -- hours minutes seconds )
6     "TIME_ZONE_INFORMATION" <c-object>
7     dup GetTimeZoneInformation {
8         { TIME_ZONE_ID_INVALID [ win32-error-string throw ] }
9         { TIME_ZONE_ID_UNKNOWN [ TIME_ZONE_INFORMATION-Bias ] }
10         { TIME_ZONE_ID_STANDARD [ TIME_ZONE_INFORMATION-Bias ] }
11         { TIME_ZONE_ID_DAYLIGHT [
12             [ TIME_ZONE_INFORMATION-Bias ]
13             [ TIME_ZONE_INFORMATION-DaylightBias ] bi +
14         ] }
15     } case neg 60 /mod 0 ;