From f5e678c3801cd33f0348ac67b631784c6cb6e250 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 19 Mar 2008 19:37:04 -0500 Subject: [PATCH] work on gmt-offset on windows --- extra/calendar/windows/windows.factor | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/extra/calendar/windows/windows.factor b/extra/calendar/windows/windows.factor index 9e34fdac00..acbae2fcd3 100755 --- a/extra/calendar/windows/windows.factor +++ b/extra/calendar/windows/windows.factor @@ -8,8 +8,14 @@ T{ windows-calendar } calendar-backend set-global : TIME_ZONE_ID_INVALID HEX: ffffffff ; inline -M: windows-calendar gmt-offset ( -- float ) +M: windows-calendar gmt-offset ( -- hours minutes seconds ) "TIME_ZONE_INFORMATION" - dup GetTimeZoneInformation - TIME_ZONE_ID_INVALID = [ win32-error ] when - TIME_ZONE_INFORMATION-Bias 60 / neg ; + dup GetTimeZoneInformation { + { [ dup TIME_ZONE_ID_INVALID = ] [ win32-error ] } + { [ dup { TIME_ZONE_ID_UNKNOWN TIME_ZONE_ID_STANDARD } member? ] + [ TIME_ZONE_INFORMATION-Bias 60 / neg ] } + { [ dup TIME_ZONE_ID_DAYLIGHT = ] [ + [ TIME_ZONE_INFORMATION-Bias 60 / neg ] + [ TIME_ZONE_INFORMATION-DaylightBias ] bi + ] } + } cond ;