Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

Why Your Date Shows 1970: Unix Timestamps in Seconds vs Milliseconds

Why Your Date Shows 1970: Unix Timestamps in Seconds vs Milliseconds You fetch a timestamp from an API, pass it to new Date(), and the screen says January 20, 1970.

  • Unix timestamps count seconds or milliseconds since Jan 1, 1970
  • Mistakes from treating seconds as milliseconds or vice versa
  • Use appropriate unit in code to avoid incorrect dates

More from Wednesday 30 September →