DateTimeDiff returning negative values in Architect Data Action

Running into a headache with date comparisons in an Architect flow. We’re trying to filter out interactions older than 24 hours before sending them to an external endpoint via a Data Action.

I’ve set up a Data Action with a dateTimeDiff function. The goal is simple: calculate the difference in hours between the current time and the interaction’s creation timestamp. If the result is greater than 24, we drop it.

Here’s the expression I’m using for the output variable age_in_hours:

${dateTimeDiff(currentTime(), interaction.createdTime, "hours")}

The problem is that dateTimeDiff seems to return a negative number when currentTime() is later than interaction.createdTime. My logic block checks age_in_hours > 24, but since the value is negative (e.g., -45.2), the condition fails and the data gets sent anyway. It feels like the function expects the older date first, but the documentation isn’t super clear on the argument order for the duration calculation.

I’ve tried swapping the arguments:

${dateTimeDiff(interaction.createdTime, currentTime(), "hours")}

Now I get positive values, but the logic feels inverted compared to how I’d expect a diff function to work (current minus past). Is there a standard way to handle this without adding a conditional negate block? Or am I missing a parameter that controls the sign?

Also, just to be sure, currentTime() pulls the system time, right? Not the user’s local timezone? We’re in London, so UTC alignment matters here.

Try swapping the order of arguments in dateTimeDiff. It’s likely calculating creationTime - now instead of now - creationTime, which flips the sign.