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