factor/extra/calendar/windows/windows.factor

14 lines
416 B
Factor
Raw Normal View History

2008-01-24 18:19:45 -05:00
USING: calendar.backend namespaces alien.c-types
windows windows.kernel32 kernel math ;
2007-09-20 18:09:08 -04:00
IN: calendar.windows
TUPLE: windows-calendar ;
T{ windows-calendar } calendar-backend set-global
2007-09-20 18:09:08 -04:00
M: windows-calendar gmt-offset ( -- float )
"TIME_ZONE_INFORMATION" <c-object>
[ GetTimeZoneInformation win32-error=0/f ] keep
[ TIME_ZONE_INFORMATION-Bias ] keep
TIME_ZONE_INFORMATION-DaylightBias + 60 /f neg ;