Always_a_learner
Always_a_learner

Reputation: 5055

How to ignore IANA backward compatible values of timezone in moment js library or javascript Intl API?

I am using moment-timezone package to get current time zone values. I need value like America/New_york, Asia/KolKatta.

import * as Moment from 'moment-timezone';
Moment.tz.guess()

It works fine, but gives Asia/Calcutta instead of Asia/KolKatta. Another solution for getting timezone name I found is

Intl.DateTimeFormat().resolvedOptions().timeZone

Related Question on SO Moment Timezone returns correct timezone but with wrong spelling

Please suggest if someone knows the solution to fix this issue in Javascript?

Upvotes: 1

Views: 153

Answers (0)

Related Questions