3

If I do:

new Date().getTime()

I get a number of length 13

And according to What is JavaScript's highest integer value that a number can go to without losing precision?

The biggest number that can be presented is:

9007199254740991

Which is of length 16

So it's a matter of time before getTime() will go beyond the limits of integer, what happens then?

Shai UI
  • 50,568
  • 73
  • 204
  • 309

1 Answers1

7

So it's a matter of time before getTime() will go beyond the limits of integer, what happens then?

That won't happen for another 285,568 years. (The value of getTime() is measured in milliseconds since the start of the year 1970.)

If humans are still around when that happens, and they're still using Javascript… well, hopefully they'll come up with some kind of workaround. :)

  • 1
    JavaScript may not be around, even humans may not be around... but Internet Explorer will be there and someone will have to come up with a polyfill. – Gerardo Furtado May 11 '18 at 04:19