Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Help with DST Expression

    Posted 06-05-2025 19:14

    dbabyn | 2023-05-10 14:58:08 UTC | #1

    Our Daylight Savings time springs forward the second sunday in March at 2AM MST and falls back the first Sunday of November at 2AM MST so I have tried modifying this expression in an UPDATE DATA ACTION provided by Genesys. I am pretty new to expressions and can't quite understand it all. Any help would be greatly appreciated.

    DateTime values in Architect flows and Daylight Savings Time (DST) calculations - Genesys Cloud Resource Center (mypurecloud.com)

    Here is the modified Expression but it errors at (Month(Flow.UtcDateTime) > 3)

    AddMinutes(Flow.StartDateTimeUtc,
    (
              If(Flow.StartDateTimeUtc >= GetDayOfWeekOccurrence(1,-1,Year(Flow.StartDateTimeUtc),3,1,0,0)
                   and Flow.StartDateTimeUtc <= GetDayOfWeekOccurrence(1,-1,Year(Flow.StartDateTimeUtc),10,1,0,0),
                   -360,
                   -420)
         )
    )
    (
          (Month(Flow.UtcDateTime) > 3)
            or
          (Month(Flow.UtcDateTime) == 3 and Month(AddDays(Flow.UtcDateTime, -7)) == 3 and Month(AddDays(Flow.UtcDateTime, -14)) == 3)
            or
          (
            (Month(Flow.UtcDateTime) == 3 and Month(AddDays(Flow.UtcDateTime, -7)) == 3 and Month(AddDays(Flow.UtcDateTime, -14)) == 2)
              and
            (DayOfWeek(Flow.UtcDateTime) > 1 or (Hour(Flow.UtcDateTime) >= 2))
          )
        )
        and
        (
          (Month(Flow.UtcDateTime) < 11)
            or
          (
            (Month(Flow.UtcDateTime) == 11 and Month(AddDays(Flow.UtcDateTime, -7)) == 10)
              and
            (
              (DayOfWeek(Flow.UtcDateTime) == 1 and Hour(Flow.UtcDateTime) < 2)
                or
              DayOfWeek(Flow.UtcDateTime)!=1
            )
          )
        )

    system | 2023-06-09 14:53:47 UTC | #2

    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: 19818