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

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

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 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