I'm trying to add/subtract days from moment time object. However, the problem im having is that the time offset is different then the local time of the server.
in db my time
2019-08-14T21:38:50-04:00
however, locally I get +0000
moment().format('YYYY-MM-DD hh:mm ZZ')
2019-08-15 07:19 +0000
so now if I try to convert the time stored in the db
moment("2019-08-14T21:38:50-04:00").format('YYYY-MM-DD hh:mm ZZ')
2019-08-15 01:38 +0000
if I use parseZone() I get
moment.parseZone("2019-08-14T21:38:50-04:00").format('YYYY-MM-DD hh:mm ZZ')
2019-08-14 09:38 -0400
I also tried manually removing the offset of 4 hours (to balance it out?)
moment("2019-08-14T21:38:50-04:00").utcOffset(-240).format('YYYY-MM-DD hh:mm ZZ')
2019-08-14 09:38 -0400
But the value out (after formatting) is always different then in.
How do I get 2019-08-14T21:38:50-04:00 as the output after I format moment obj back to a string?