A cloud-based identity and access management service for securing user authentication and resource access
DateDiff function in Entra Id provisioning does not correctly identify same date...
I'm working with the Workday Writeback provisioning app & we have a requirement that the users UPN should not be written back to Workday until the day of the employees hire date.
(Documentation here: https://learn.microsoft.com/en-us/entra/identity/saas-apps/workday-writeback-tutorial#timing-the-writeback-for-pre-hires)
I've found multiple issues with MS's documentation surrounding the IIF function already, including in the following documentation: https://learn.microsoft.com/en-us/entra/identity/saas-apps/workday-writeback-tutorial#timing-the-writeback-for-pre-hires, where it shows in the example query provided that the IIF function should be as follows: IIF(Condition, False, true). It also impacts most other documentation that includes the IIF function... (IE in examples provided for the DateDiff function itself: https://learn.microsoft.com/en-gb/entra/identity/app-provisioning/functions-for-customizing-application-data#datediff)
However the IIF function is actually documented (on the same page) to be as follows: IIF(condition, True, False). https://learn.microsoft.com/en-us/entra/identity/app-provisioning/functions-for-customizing-application-data#iif
While debugging the above issue, I have also found that the DateDiff function doesn't actually compare the dates correctly.
For instance: DateDiff("2026-01-06-01:00", "2026-01-06-09:00") = 0
however, DateDiff("2026-01-06-01:00", "2026-01-06-23:00") = 1 (tomorrow)
Both should be "0", because they are in fact the same date, however, it appears that the DateDiff function doesn't actually check the date at all... instead it simply takes the time & applies a +/- 12 hour sum, if the difference (Now() VS Now(-13 hours)) is true, it returns "-1" (yesterday).
This flawed logic has a knock on impact for multiple MS products including Power Automate Azure Provisioning, as it incorrectly assumes a 12 hour day (or simply ignores the fact that both timestamps are within the same dates 24 hour period).
Does anyone have a workaround for this?