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

188
Visualizações
firebase firestore timestamp out of range

If I do: new firebase.firestore.Timestamp.now() and use console.log() on it, the console prints out the following:

{"nanoseconds": 89000000, "seconds": 1631289143}

If I now take those nanoseconds and seconds and try to create out of that the same timestamp like this: new firebase.firestore.Timestamp(89000000, 1631289143) I receive the error:

FirebaseError: Timestamp nanoseconds out of range: 1631289143

Can someone pls explain this strange behavior to me? How is it possible that I cannot recreate the timestamp from just few seconds ago?

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

0

This is because you are swapping the values: The second argument passed to the Timestamp constructor shall be the nanoseconds (89000000 in your example) but, instead, you pass the value of seconds (1631289143 in your example, which is out of the allowed range, i.e. 0 to 999,999,999 inclusive).

You should do

new firebase.firestore.Timestamp(1631289143, 89000000);

You probably did the error because console.log sorts the object properties...

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