Time on Windows doesn't deal with dates before 1970 #1369
Labels
bug
Something isn't working
good first issue
Good for newcomers
platform-windows
This issue is for the Windows platform build
We are using
gmtime_s
andlocaltime_s
on Windows.However, both of these functions don't accept negative seconds (since epoch), and thus don't work for dates before 1970.
Currently neither the Windows, nor the Posix versions check that the system calls actually succeed. (Both should).
The nicest is probably to try the system call, and then fall back to an equivalent range if the system call fails. See V8 for how to map to an equivalent range: https://github.com/v8/v8/blob/21ab8287a61ef260a2ae7a38f42426fa6f35c39c/src/date/date.h#L113
Test is currently marked as failing on Windows (permalink to current revision):
toit/tests/fail.cmake
Line 29 in 8d5aea4
The text was updated successfully, but these errors were encountered: