The API only returns a text value for the time zone when you call either ‘/api/v2/account’ or ‘/api/v2/business_hours’. How can you get the actual offset integer from that?
Hi Rob,
Apart from the API returning the timezone offset numeric value, the simplest way to get the offset value from timezone name is using this npm package
The usage would be as depicted below
import {getTimezone} from 'countries-and-timezones';
const ausTimezone = 'Australia/Melbourne';
console.log(getTimezone(ausTimezone));
Regards,
Thakur
Thanks @Thakur_Ganeshsingh. I ended up hard coding all the options in the drop down. This npm package is great.
Sorry to hear that @RobAtOpinyin.
We shall try to time-bound these things to avoid such scenarios further. Looking forward to an active engagement in future.
This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.