Closed minoki closed 1 year ago
The SML-side of MLton's implementation of Date.localOffset
is just a thin wrapper around the Data_localOffset
C function defined in ./runtime/basis/System/Date.c
:
It does seem as though eastern regions are expected to be negative, based on the comments in ./basis-library/system/date.sml
:
Most of these "system" functions are meant to be thin wrappers around C Library functions; is there such a function that we should be using, rather than the implementation above?
The "thin wrapper" part may be buggy:
Shouldn't it be rem
instead of mod
?
That might work. I need to look at the specifications of the various functions involved more carefully.
I expected
Date.localOffset ()
to return negative time for eastern regions (e.g.~32400.000
for UTC+9), but MLton returns a positive value.Code:
Expected output on UTC+9:
Actual output on UTC+9: