Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!