Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda