DateTimeDiff returns NaN when comparing ISO strings from external API

The expression DateTimeDiff(currentTime, externalDate, ‘days’) is consistently returning NaN in our data action. We are pulling an ISO 8601 string directly from a webhook payload, but the function seems to choke on the timezone offset format. The incoming payload looks like this: 2024-11-05T14:30:00+02:00. When I try to parse this in a standard Architect expression, it fails silently.

I have tried converting the string using ParseDateTime first, like ParseDateTime(externalDate, 'yyyy-MM-ddTHH:mm:ssZ'), but that also returns null. It’s not just a formatting issue, I think. The documentation for DateTimeDiff is sparse regarding timezone-aware inputs from external sources. We’re using Genesys Cloud version 2024.11.0 in the EU Central region.

Here is the relevant snippet from our data action configuration:

{
 "expressions": [
 {
 "id": "calcAge",
 "expression": "DateTimeDiff(Now(), ${externalDate}, 'days')",
 "type": "NUMBER"
 }
 ]
}

If I hardcode a date string like '2024-11-01T00:00:00Z' it works fine. The issue only arises with the dynamic variable from the webhook. We’ve verified the webhook payload is correct using Postman and the CXone Admin API logs. The externalDate variable type is set to STRING in the data action.

Is there a specific format required for DateTimeDiff when dealing with dynamic inputs? Or do we need to strip the +02:00 offset before passing it to the function? We’ve tried using Replace to remove the offset, but that feels like a hack. There must be a cleaner way to handle ISO 8601 strings with timezone offsets in Architect expressions. Any pointers would be appreciated. We’re hitting a wall here and need to get this deployed by EOD Berlin time.