Legacy Dev Forum Posts

 View Only

Sign Up

Question about timezone API support on DST

  • 1.  Question about timezone API support on DST

    Posted 06-05-2025 18:23

    nicholasms | 2022-08-18 11:56:13 UTC | #1

    Hello,

    I originally opened a Genesys customer care ticket for this question, but I got redirected to here.

    We are trying to build an 'Advanced OOH' feature for our customer that triggers certain actions after we identified a voice call is currently in out of office/holiday. The concept is for admins to be able to control what to do based on the current hour, e.g. at 9-10pm they want the ooh calls to be routed to external number, at 10-11pm they want the ooh calls to go to a certain queue etc.

    To achieve this, we designed a data table having 24 fields representing all possible hours in a day so that we can grab the appropriate action based on the current hour. But the problem here is that we need to account for timezone and DST for the different voice lines our customer has.

    After numerous tries, we decided to go for the following method:

    1. After evaluate schedule group and determined this is OOH/holiday, we grab the timezone from the schedule group with Task.ScheduleX.timeZone, this returns the string value of the time zone e.g. Europe/London
    2. We use the timezone API /api/v2/timezones to grab a list of all timezones with the offset values
    3. We match the timezone id from the API call result and obtain the offset value in minutes, then we calculate the local time using AddMinutes on GetCurrentDateTimeUtc

    This method more or less works, however does the timezone API offset return actually account of the Daylight Saving? We need a confirmation as we cannot find this documented anywhere.

    It does seems to account for DST as the current return of Europe/London is "offset": 60 i.e. UTC+1 which is correct.


    VaunMcCarthy | 2022-09-12 07:04:36 UTC | #2

    HI Nicholas, can you please let me know how you're obtaining a single timezone from that API in step 2?


    nicholasms | 2022-09-12 08:04:46 UTC | #3

    Hello,

    At first I tried using a contract input value in the Translation Map so that I can grab the desired timezone directly from Data Action, unfortunately this wasn't supported by Genesys. For ref: there was an idea raised for this: https://genesyscloud.ideas.aha.io/ideas/OTB-I-224

    With no other choice, I decided to grab the whole list in architect and store it in a collection, then I made a loop to compare the timezone value and grab the corresponding offset - not very efficient but I cannot think of any better way.

    Hope this helps.

    Nicholas


    system | 2022-10-13 08:04:55 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 15948