From an API, I'm getting back timestamps in milliseconds, as UTC. I'm using MomentJS in an Angular project (utilizing angular2-moment
). First I setup:
moment.utc(dEvent.date.start)
And this displays fine, but of course, in the wrong timezone. I want to specifically display the time in US Eastern, and so found Moment Timezone. According to the docs, I should be able to convert the timezone of a Moment object with the tz
method, so I tried:
moment.utc(dEvent.date.start).tz('America/New_York')
VSCode makes no complaint about this, but the Angular compiler says
__WEBPACK_IMPORTED_MODULE_6_moment__.utc(...).tz is not a function
As VSCode doesn't complain, I'm not sure where I've gone wrong. Did I screw up Angular, Typescript, or MomentJS?