I need to get the current date in my TypeScript application. It is now 13:35 for me.
When using moment(Date.now()).toDate()
I get the current date, but an hour too early than what I would expect:
"2020-03-26T12:35:12.938Z"
This gives me 12:35.
When using moment(Date.now()).format("DDMMYYYY_HHmm")
I get the current date with the hour I am expecting: "26032020_1335"
This gives me 13:35.
What am I missing here to get the correct date and time? To be clear, i need a Date object. Not a string.