1 USING: accessors calendar combinators kernel math math.functions
2 system windows.errors windows.kernel32 ;
5 : timestamp>SYSTEMTIME ( timestamp -- SYSTEMTIME )
16 [ - 1000 * >integer ] 2bi
18 } cleave \ SYSTEMTIME boa ;
20 : SYSTEMTIME>timestamp ( SYSTEMTIME -- timestamp )
27 [ [ wSecond>> ] [ wMilliseconds>> 1000 / ] bi + ]
28 } cleave instant <timestamp> ;
31 TIME_ZONE_INFORMATION new
32 dup GetTimeZoneInformation {
33 { TIME_ZONE_ID_INVALID [ win32-error ] }
34 { TIME_ZONE_ID_UNKNOWN [ Bias>> ] }
35 { TIME_ZONE_ID_STANDARD [ Bias>> ] }
36 { TIME_ZONE_ID_DAYLIGHT [ [ Bias>> ] [ DaylightBias>> ] bi + ] }
37 } case neg 60 /mod 0 ;
40 SYSTEMTIME new [ GetSystemTime ] keep SYSTEMTIME>timestamp ;