Moment converts the offset date to the local time zone of the computer you are on if you use the default constructor function.
For this reason, your code is working as expected. The date is taken from -6 and converted to a local offset.
If you want to use the date in the specified time zone offset, use the moment.parseZone parameter:
moment.parseZone('2016-03-13T23:59:59.999-06:00').format() "2016-03-13T23:59:59-06:00"
If you want to ignore the time zone offset and work in local time, specify a format that does not include the offset. By doing this, you cause displacement to be ignored.
moment('2016-03-13T23:59:59.999-06:00', 'YYYY-MM-DDTHH:mm:ss.SSS').format() "2016-03-13T23:59:59-05:00"
Please note that I am in UTC-5 and the offset is displayed as -5 because I ignored the offset in the date.
A parsing guide can help: http://momentjs.com/guides/#/parsing/
source share