How to write logic for a custom wait step to determine wait time based on custom time zone criteria | Community
Skip to main content
Level 1
April 7, 2026
Question

How to write logic for a custom wait step to determine wait time based on custom time zone criteria

  • April 7, 2026
  • 1 reply
  • 19 views

I am trying to solve a particular use case whereby I use a custom wait activity to determine how long to wait before a customer is sent communications. This custom wait activity needs to based on the customer’s Australian time zone. Importantly we do not have time zone preference details enabled in AEP/AJO because we do not have this source data. We might in the future. Therefore I am trying to determine if we can use the advanced expression editor to write the necessary logic within the journey to determine the customer’s wait time. 

 

GOAL: if time of event is X-time or later local time pass through the condition and send email/SMS, else wait Z-mins until it is X-time customer local time before continuing onto the next journey node. I want this to automatically calculate/adjust for daylight savings instead of manually updating wait times whenever daylight savings changes. For example if the goal is to send comms at 12pm noon, this means if the customer is in WA (Western Australia [Perth]) and the current local time = 10 am the wait time will be 120 mins; if the customer is in the QLD (Queensland) and it's 11 am local time the wait time will be 60 mins; if the customer is in NSW (Sydney) and the current date is Friday 3 April and the time is 11:30 am the wait time is 30 mins. 

 

Things to note:

  • timeZone preference details is not enabled because we do not have the source data.
  • The audiences are externally created due to not having all required data in AEP. This means audiences are being ingested as XDM ExperienceEvent class type. Thus whenever a customer data is ingested as an event the journey will trigger.
  • The journey will be configured to Australia/Sydney, Eastern Australia Time, +10:00 and Australia/Sydney, Eastern Australia Daylight Savings Time, +11:00 during daylight savings months.
  • Daylight savings in Australia always starts the first Sunday of October and ends the first Sunday of April the following year.
  • We have a XDM customer data attribute for a customer’s residential state _wbg.customerAddress.residentialAddress.state, which we could possibly use in combination with calendar date to write logic that determines the customer’s time zone and wait period.
  • All ingested event data is timestamped with timestampAet so we could possibly use this data attribute as well in an expression? 
  • There is a updateTimeZone() function that could be used in the expression.

If this is possible, are you able to offer guidance on how to write the logic and expressions to calculate the custom wait times?

 

I presume the business logic might be something like the following, but I am unsure how to translate this to write the correct AJO syntax. 

 

Option 1 (maybe)?

If state = WA

     Wait time = (12pm subtract current time Australia Western Standard Time
     AWST UTC +8) mins

Else if state = NT

     Wait time = (12pm subtract current time Australian Central Standard Time
      ACST UTC +9.30) mins

Else if state = SA
AND today's date = (first Sunday of April [current year] —
(first Sunday October [current year] - 1 day))

     Wait time = (12pm subtract current time Australian Central Standard Time
     ACST UTC +9.30) mins

Else if state = QLD

     Wait time = (12pm subtract current time Australian Eastern Standard Time
     AEST UTC +10) mins

Else if = (NSW or ACT or VIC or TAS)

AND today's date = (first Sunday of April [current year] — 
(first Sunday October [current year] - 1 day))

     Wait time = (12pm subtract Australian Eastern Standard Time
      AEST UTC +10) mins

Else if state = SA

AND today's date = (first Sunday of October [current year] — 
(first Sunday April [current year + 1] - 1 day))

     Wait time = (12pm subtract current time Australia Central Daylight Savings
     Time ACDT UTC +10.30) mins

Else 

     Wait time = (12pm subtract Australian Eastern Daylight Savings Time
     AEDT UTC + 11) mins

 

Option 2 (maybe)?

Or alternatively, inside each if/else if statement should the calculation be be written as:

     Wait time = (12pm - updateTimeZone(timestampAet) mins

 

Option 3 - alternative approach?

Is there a better way to achieve this?

    1 reply

    Anuhya-Y
    Community Advisor
    Community Advisor
    April 7, 2026

    @KeironWratt 

    I understand that the source data currently doesn’t include time zone information. Just a thought , would it be possible to transform the data before/while loading it into AEP? If you already have attributes like state and country,  derive the corresponding time zone and enrich it at the profile level.

    Having time zone available can help avoid custom logic around wait activities and daylight saving adjustments. AJO can natively use this for scheduling, ensuring communications align with the user’s local time and automatically adapt to daylight saving changes.

    It could also help enable a few other AJO capabilities (sendtime optimization etc) more effectively without additional customization.