I am trying to use moment-timezone in my class. This is my typings.
\"moment\": \"github:DefinitelyTyped/DefinitelyTyped/moment/moment.d.ts#a1575b96ec38e91675062
I will update this for 2020.
$ npm install moment-timezone @types/moment-timezone
import moment from 'moment-timezone';
...
// do this - outside of any class is fine
moment.tz.add('America/Los_Angeles|PST PDT|80 70|01010101010|1Lzm0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0');
...
someMethod() {
const m = moment(the_date);
...
const mFormatted = m.tz('America/Los_Angeles').format('YYYY-MM-DDTHH:mm:ssZZ');
}
Timezone defs can be found at https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json. I use this to define my own rather than read them all in.