I have a momentjs object that contains a date and time with an offset. This momentary object was created from its string representation:
var x = moment("2017-02-08T04:11:52+6:00")
After working with the object, I would like to get the same textual representation from the object of the object.
When I try to format the object, I get the following results:
x.format() => "2017-02-08T04:11:52+14:00"moment.parseZone(x).format("YYYY-MM-DDTHH:mm:ssZ") => "2017-02-07T14:11:52+00:00"
How can I format my moment object in such a way as to have the same idea again?
source
share