I would like to convert a date from my filter to UTC time and then to seconds keeping the UTC time / not the local time.
Examples:
new Date() // Wed Aug 19 2020 15:28:09 GMT+0200 (Central European Summer Time)
moment.utc(new Date()).format() // correctly outputs 2020-08-19T13:28:09Z - so -2h
moment.utc(new Date()).format('X') // unix timestamp 1597843870 - 19/08/2020, 15:31:10 Summer Time returns time plus 2h - not what I want
moment.utc(new Date()).unix() // again as above unix timestamp 1597843870 - 19/08/2020, 15:31:10 Summer Time returns time plus 2h - not what I want
So to summarize I need to convert the UTC formatted time to a number of seconds so it is (whenever converted with convertor the same number of seconds). Meaning this: moment.utc(new Date()).format() after conversion to seconds needs to be 1597843689
Is there any reasonable way how this could be done with a moment?