Is there a way to convert session.timeZone(IANA format) to Windows Format?

I am using a MS Graph integration which requires time-zone in Windows format as input. Airkit uses IANA time-zone format in session.timeZone(session data). Is there a way to convert from IANA to Windows format?

Example of IANA format: America/New_York, America/Los_Angeles etc.

Example of Windows format: Eastern Standard Time, Pacific Standard Time etc. (Microsoft time-zones acceptable)

Note: Researched and found a few public time-zone APIs, but they wont exactly convert the IANA format into Windows format.

hey @Ankit_Chaudhari !
Well, there’s no built-in way to do so, but the World Time API might get you closer.

Here’s a sample request/response:

# curl "http://worldtimeapi.org/api/timezone/America/Los_Angeles"
{
  "abbreviation": "PDT",
  "client_ip": "192.184.48.10",
  "datetime": "2022-05-05T14:41:39.630249-07:00",
  "day_of_week": 4,
  "day_of_year": 125,
  "dst": true,
  "dst_from": "2022-03-13T10:00:00+00:00",
  "dst_offset": 3600,
  "dst_until": "2022-11-06T09:00:00+00:00",
  "raw_offset": -28800,
  "timezone": "America/Los_Angeles",
  "unixtime": 1651786899,
  "utc_datetime": "2022-05-05T21:41:39.630249+00:00",
  "utc_offset": "-07:00",
  "week_number": 18
}

As you can see it doesn’t return the exact naming you need, but this request coupled with a TZ reference table
that lists the full list of Time Zones. might do.

Let me know if this helps!

1 Like

Thanks @juanchax ! You helped me think in the right direction. I created an AirData object from the mapping doc(IANA to Windows format). Then, used the IANA format as an input to the reference table and fetch Windows time-zone.