Version
110.99.4 (Latest)
Operating System
OS Version
No response
Processor
System Component
Basis Library
Severity
Minor
Description
In the SML Basis Library, Date.fromTimeLocal has the following document string (emphasis mine):
fromTimeLocal t
fromTimeUniv t
These convert the (UTC) time t into a corresponding date. fromTimeLocal represents the date in the local time zone; it is the analogue of the ISO C function localtime. The returned date will have offset=NONE. fromTimeUniv returns the date in the UTC time zone; it is the analogue of the ISO C function gmtime. The returned date will have offset=SOME(0).
This is not how the function is implemented in SML/NJ:
fun fromTimeLocal t = let
val offset = localOffsetForTime (timeToNs t)
in
tm2date (localTime t, SOME offset)
end
fun tm2date (tm, offset) = DATE{
(* ... *)
offset = offset,
(* ... *)
}
Transcript
- Date.offset (Date.fromTimeLocal (Time.now ()));
val it = SOME (TIME {usec=18000000000}) : time option
Expected Behavior
- Date.offset (Date.fromTimeLocal (Time.now ()));
val it = NONE : time option
Steps to Reproduce
See transcript
Additional Information
This isn't a big deal, but incompatibilities should be documented, especially since the SML/NJ documentation page simply links to smlfamily.github.io.
Email address
skyler.soss@gmail.com
Version
110.99.4 (Latest)
Operating System
OS Version
No response
Processor
System Component
Basis Library
Severity
Minor
Description
In the SML Basis Library,
Date.fromTimeLocalhas the following document string (emphasis mine):This is not how the function is implemented in SML/NJ:
Transcript
Expected Behavior
Steps to Reproduce
See transcript
Additional Information
This isn't a big deal, but incompatibilities should be documented, especially since the SML/NJ documentation page simply links to
smlfamily.github.io.Email address
skyler.soss@gmail.com