1

I am trying to print the short name of the chosen timezone. It works good for all the timezones except for a few Asian timezones. For 'Asia/Calcutta' it prints 'GMT+5:30' but I expect 'IST'

Any clue? Sandbox: https://codesandbox.io/s/material-demo-5bub4

import { DateTime } from 'luxon';
const timeZone = 'Asia/Calcutta';
const timeZoneAbbreviation = DateTime.local().setZone(timeZone).toFormat('ZZZZ');
console.log(timeZoneAbbreviation);
Hamada
  • 1,836
  • 3
  • 13
  • 27
  • See the part in the answer of the linked duplicate where I explain using the `locale` option. You could also use `setLocale` if you prefer. – Matt Johnson-Pint Jul 14 '20 at 15:52

0 Answers0