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

159
Vistas
Javascript Date object return same hour for different timestamps

I have two separate timestamps: '2021-03-28T02:00:00' and '2021-03-28T03:00:00'

Both dates return the same JS timestamp: Sun Mar 28 2021 03:00:00 GMT+0200 (Central European Summer Time)

I believe this is because Central European Summer time starts 2021-03-28T02:00:00 but then I would expect 2021-03-28T03:00:00 to return 04:00:00 and not 03:00:00.

In short. I need the date '2021-03-28T02:00:00' to return: Sun Mar 28 2021 02:00:00 GMT+0200 (Central European Summer Time)

How come this is not what I am getting? why do I get the same timestamp from the two different dates?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

2021-03-28T02:00:00 cannot return what you want because such a time doesn't exist in practice. One second earlier, 2021-03-28T001:59:59 GMT+0100 exists, but as soon as the next second elapses the time becomes 03:00:00 GMT+0200.

You will have to modify your surrounding code in some other way, to remove the 'need' to display an impossible time.

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