Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda