I'm having trouble converting my date to the correct time zone using moment.js. Every time I try, I end up with the entire thing without a time specification.
Here is the snippet of code from my program:
console.log(von);
console.log(bis);
var nVon = moment.tz(von, "Europe/Berlin");
var nBis = moment.tz(bis, "Europe/Berlin");
console.log(nVon.format());
console.log(nBis.format());
When I check the console, this is what I see:
2022-10-31T00:00:00+01:00
And here is the original German format that I aim to store in MongoDb with the correct time zone:
https://i.sstatic.net/mg3pN.jpg
The issue arises when it gets saved in MongoDB with an hour loss like this, lacking UTC information: 2022-10-31T19:44:39.000+00:00