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

152
Visualizações
New Date() and New Date(string) not using the same timezone

In JavaScript, why does those two lines of code use different time zone?

new Date("09/12/2021 15:00:03 UTC")

Returns Sun Sep 12 2021 11:00:03 GMT-0400 (Eastern Daylight Time)

new Date()

Returns Sun Sep 12 2021 10:00:03 GMT-0500 (Eastern Standard Time)

Why are they not both on GMT-0500 (Eastern Standard Time)???

The lines are one after the other in code, so they are run by the same server.

Thanks.

-- EDIT --

I tried with ISO format and the timezone is still wrong.

new Date("2021-09-12T16:34:14.000Z")

And the output is Sun Sep 12 2021 12:34:14 GMT-0400 (Eastern Daylight Time)

about 4 years ago · Juan Pablo Isaza
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