-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time.Posix has insufficient range #27
Comments
The documentation then says:
As Javascript is the only target for now, and the operations used for But you're right that some care must be taken if a new target like WebAssembly is one day supported. |
"some operations"? |
Operations that only work in 32bit are bitwise operations: Plus a few others that use them indirectly. |
That is not documented anywhere - Elm is notoriously awfully documented. For example integer division will only work for 32-bit values so if you try to calculate average of two timestamps that will not work. Also since "some operations" is not defined, list of those operations can change at any time. So e.g. addition could suddenly stop working. |
Time.Posix is defined as
type Posix = Posix Int
where the integer field is in milliseconds since Jan. 1, 1970. However, the language documentation for Int states that
"Int math is well-defined in the range -2^31 to 2^31 - 1. Outside of that range, the behavior is determined by the compilation target."
This means that Posix time is only guaranteed to be able to represent times between 07 Dec 1969 03:28:37 UTC and 25 Jan 1970 20:31:22 UTC.
The text was updated successfully, but these errors were encountered: