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