On Item 2 - Just like the utc()
function, there's also a local()
function. Once you have a moment
object, you can use toDate
or format
or any other of the functions described in the documentation. No, you do not need to create a new moment using the generated date object.
moment.utc(utcDateTime, utcDateTimeFormat).local().format(specifiedFormat)
Again, there's more than one way to do things here. If the utcDateTime
is already in ISO8601 format, and contains either a Z
or an offset like -01:00
, then that will be taken into account and you can simply do this:
moment(utcDateTime).format(specifiedFormat)