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

140
Visualizações
Why MongoDB store the timestamp with -1hour than the actual hour on my computer

I have a collection who contains info about containers and specially the timestamp of when I have read the info (for each elements in the collection). The only problem is that the timestamp is suddenly converted into UTC despite when I read the timestamp it's UTC + 1 (who is the right one).

Someone know from where my problem could comes ?

Maybe it could help you to see the JavaScript:

DockerStats.insert({
          read: moment(new Date()).unix(),
          precpu_stats: stat.precpu_stats,
          cpu_stats: stat.cpu_stats,
          memory_stats: stat.memory_stats,
          blkio_stats: stat.blkio_stats,
          pids_stats: stat.pids_stats,
          networks: stat.networks,
});

And if I display the read time:

1484895487 who is 07:58am

But when I read it it's 06:58am on my client

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Mongodb stores all time data in utc. So if you use local time, you should convert it back on reading. Or let your mongodb driver to do it. Read more about it (with suggested workaround) here:

https://docs.mongodb.com/v3.4/tutorial/model-time-data/

over 4 years ago · Santiago Trujillo 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