Show datetime in the specified time zone


#1

I’m trying to display a datetime in the UI. I want the time displayed to reflect the time zone of the datetime. Not UTC, not the browser localTime. Is there a format or way to use localTime or momentHelper to display a time that way? Really anything I can use out of UIHelper?

To clarify: localTime displays the time in the browser time zone. momentHelper displays the time in UTC. If my datetime is “2018-11-19T08:09:47-10:00” I would like it to say “11/19/2018 8:09 AM”


#2

The solution that worked for me was creating my own function.
`function regionalTime(value, format) {

return moment(value).utcOffset(value).format(format || “M/D/YYYY h:mm:ssa”);
}`

moment always uses the local time so you need to manually offset.