How to find current day in AJO | Community
Skip to main content
Level 1
February 2, 2026
Question

How to find current day in AJO

  • February 2, 2026
  • 2 replies
  • 53 views

I have a field called ReminderDay in my profile schema. The value can be  Sunday, Monday, Tuesday, Wednesday, and so on.


When a profile enters the journey, I want to send the email only on the reminderDay. For example, if the profile’s ReminderDay value is Friday and  If today is Friday, the email should be sent immediately. If today is not Friday, the profile should wait until the upcoming Friday before receiving the email.Due to limitations on the number of nodes, I want to implement this logic using custom code in the wait condition.

However, I am struggling to determine the current day within the custom code.
Is there a way to retrieve the current day using custom code, or is there an alternative approach that achieves this with a minimal number of nodes?


Thanks ,in Advance

Deepak Vasudevan​

2 replies

Pulkit_Jain_
Adobe Employee
Adobe Employee
February 3, 2026

You can use "now" to retrieve the current day example: formatDate(now, "EEE").
But you can't use this directly in a custom wait expression to compute the next weekday, because custom wait requires a timestamp so an alternative could be to use a condition node that checks weekday, paired with a 24‑hour wait node.
Example -
lowerCase(formatDate(now,"EEE")) == lowerCase(#{ExperiencePlatform.ProfileFieldGroup.profile.ReminderDay})
Paths: True → Email ; False → Wait 24 hours → go back to Condition
Profiles will naturally keep checking daily until their ReminderDay matches today.

Level 1
February 3, 2026

Are you sure formatDate(now, "EEE") will work? As per my understanding this will work only inside the personalization editor. 

When I was trying print the result of formatDate(now, "EEE") to a webhook, I’m getting the below error.

The expression is invalid : Unexpected word 'formatDate' . Please, check that it is a valid token and that you are using it at the right place.

Pulkit_Jain_
Adobe Employee
Adobe Employee
February 3, 2026

You are right, didn't realize that formatDate() mightn't be available inside journey expressions. It is ONLY available inside the Personalization Editor.
Let me dig in further.

Mohan_Dugganab
Adobe Employee
Adobe Employee
February 3, 2026

If this is a batch journey and Data Distiller is available, you can add
date_format(timestamp, 'EEEE') as an additional column and use it for further orchestration.
Reference: https://experienceleague.adobe.com/en/docs/experience-platform/query/data-distiller/overview 

 

Another approach is to store a date or datetime value:

If ReminderDays stores a date or datetime value, you can validate it using the following logic:


if ((substr(toString(now()), 8, 10)) == (substr(toString(<ReminderDay>), 8, 10))) then
(
toDateTimeOnly(setHours(now(), 8))
// Returns today's date at 8 AM
)
else
(
// For a DateTime field
toDateTimeOnly(
toDateTime(
(toInteger(toDateTime(toString(YOUR_DATE_FIELD)))) + (7 * 24 * 60 * 60 * 1000)
)
)

or

// For a Date field
toDateTimeOnly(
toDateTime(
(toInteger(toDateTime(toString(YOUR_DATE_FIELD)))) + (7 * 24 * 60 * 60 * 1000)
)
)
)