0

This timestamp 1604978063 is not correct according to new Date(1604978063)

It returns the following:

Date Mon Jan 19 1970 05:49:38 GMT-0800 (Pacific Standard Time)

When I look it up on DuckDuckGo, it looks correct. DDG results

What's happening here?

Chen
  • 107
  • 1
  • 12

1 Answers1

0

Javascript's timestamps are not standard unix timestamps. They use milliseconds and therefore require a multiplication by 1000:

new Date(1604978063 * 1000)
Evert
  • 93,428
  • 18
  • 118
  • 189