Forum Discussion
Issue with creating DateTime Condition in Microsoft Flow
- Aug 08, 2016
The adddays function returns a string (iso date format), but the first part of your less function contains a date format that has not been formatted yet, so I suspect that the string compare does not give a proper result.
You should format the ContractEndDate to the same string format as the calculated date to have the Less function work as expected.
Thanks Mike Platvoet. That worked!!
I converted the date into string as follows:
less(string(item()['ContractEndDate']), adddays(utcnow(), 15))
Hi Dear
I am writing the following to a SharePoint column but it is not getting successful, the condition is not going to YES.
@equals(string(item()['Contract_x0020_End_x0020_Date']), adddays(utcNow(), 20))
if you can guide, where is the mistake thanks in Advance
- David TroxelAug 07, 2018Copper Contributor
utcnow() has a time in it as well as the date. your contract end date likely includes a time as well, so adding 20 days will still result in a false unless the time of the contract end date and the utcNow() current time happen to be exactly the same (not impossible but very unlikely).
try using the startofday() function along with what you have. that should keep any difference in time from causing a problem.