I have stored a value in an SQLServer DB in UTC which is 2016-07-28 16:00:00.000
:
I've converted that UTC DateTime string to an ISO string in Javascript then passed that value into a moment and called toDate()
on it.
But the value output is still UTC including the offset.
So I stepped through the results of the two assignments and found the following values at each stage:
1st assignment: (UTC value 4:15 pm form DB converted to ISOString)
var isoDate = new Date('7/28/2016 4:15:00 PM').toISOString();
output value: "2016-07-28T15:15:00.000Z"
2nd assignment: (Being output as UTC plus offset instead of expected 17:15 local)
var localOutageStart = moment.utc(isoDate).toDate();
output value: Thu Jul 28 2016 16:15:00 GMT+0100 (GMT Daylight Time)
Instead I'd like to output the value in local by using the offset, so it would output this value instead in local:
desired output value: 28 07 2016 17:15:00
How can I instead output the local moment time instead of UTC plus offset? I pass the result to a Bootstrap datetime picker which I think takes a moment value.