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

272
Visualizações
Firestore Timestamp toDate() returns wrong UTC date?

I have the following dates stored in my Firestore Emulator v9.16.0:

enter image description here

As you can see in the screenshot, when my mouse hover on the EndDate, it shows the correct UTC Date, i.e. 2021-08-13T11:09:58.000Z, but when I issue the following code, it returns the wrong UTC date (2021-08-13T09:09:58.000Z):

In my localhost server Node.js:

let maintConfigRef = db.collection("Configurations").doc("Maintenance");
let maintConfigDoc = await maintConfigRef.get();

if (maintConfigDoc.exists) {
     let maintConfigData = maintConfigDoc.data();
     let endDate = maintConfigData.EndDate.toDate().toJSON(); // Returns 2021-08-13T09:09:58.000Z
     console.log(endDate); // Output "2021-08-13T09:09:58.000Z"
};

Which means it should be ...T11:09 (as shown in the tooltip) instead of ...T09:09. Anyone knows what's wrong with it and what else should I do to get it right? Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Not sure if it was a bug, but after installing firebase-tools 9.16.5, the problem disappeared:

npm install -g firebase-tools

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