Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

294
Views
Why new Date("1651214829629") show Invalid Date in chrome?

In chrome i type it will show this? i can under why?

enter image description here

>new Date("1651214829629")

Invalid Date

>new Date(1651214829629)

Fri Apr 29 2022 14:47:09 GMT+0800 (中国标准时间)

>new Date("110")

Wed Jan 01 0110 00:00:00 GMT+0805 (中国标准时间)
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Like Hao-Jung Hsieh said, if you give a string to new Date(), it will interpret it as a dateString, not a timestamp. To parse a dateString, new Date() will call Date.parse(), which is detailed in the ECMAScript docs here. Date.parse() will first time to parse the dateString according to the Date Time String Format. The Date Time String Format says that if you only give one number, that number will be interpreted as the year, which is usally in the range 0-9999 (as defined by ISO 8601), but ECMAScript provides an extension to support years outside this range, which is detailed in the Expanded Years section. With this extension, the year can be be in the range -273,790 to 273,790.

So, when you provide run new Date("1651214829629"), Chrome will interpret 1651214829629 as a year. 1651214829629 is not in the acceptable range, therefore it is an invalid date.

about 4 years ago · Juan Pablo Isaza Report

0

when you use a string, new Date() will think it's a dateString instead of a timestamp. "110" is meaning at 1:10. It just can't understand what is the dateString of "1651214829629".

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!