I am confused about JavaScript's Date
object and its getTime()
method.
From:
Minimum and maximum date
It says that the actual max and min. number of milliseconds (ms) representable by a JS Date
object is (-/+)8.640.000.000.000.000 ms since 01 January, 1970 UTC.
However, 8.640.000.000.000.000 requires 53 bits.
On the other, hand, all JS numbers are 64-bit floats with only 52 fractional bits (excluding the sign bit).
How can JS therefore store the result of Date.getTime()
when Date
is either the max or the min date value? It must use one of the exponent bits to do this, right?
Does that also mean that converting a JS Date
(via its number of ms) to int64 (e.g. for use in Qt) is not strictly possible?