Hey everyone,
Running into a weird issue with date logic in Architect. We’re trying to filter interactions based on whether they happened within the last 24 hours, but DateTimeDiff seems to be failing when the start and end times are on the same calendar day.
Here’s the setup:
- Get Data Action: Pulls
contact.attributes.timestamp(ISO 8601 string). - Assign: Parses that string into a datetime object called
contact.last_contact_date. - Get Current Time: Assigns
system.current_datetimetocontact.now. - Expression:
DateTimeDiff(contact.last_contact_date, contact.now, 'hours')
The expression evaluates to null if the difference is less than 24 hours. If I change the unit to 'minutes', it works fine. But we need hours for the downstream logic.
I’ve checked the docs, and it says DateTimeDiff returns the difference in the specified unit. I don’t see any mention of it returning null for small values. Is this a known bug, or am I missing a format requirement?
Expression: DateTimeDiff(contact.last_contact_date, contact.now, 'hours')
Input:
contact.last_contact_date = "2023-10-27T14:30:00Z"
contact.now = "2023-10-27T15:00:00Z"
Expected: 0.5 or 1 (depending on rounding)
Actual: null
Also, tried GetDayOfWeek to see if the date parsing was totally off, but that returns the correct integer (6 for Saturday). So the datetime object seems valid.
Any thoughts? We’re on the latest version of the platform.