cancel
Showing results for 
Search instead for 
Did you mean: 

Why Date Diff is deprecated in Blue Prism 7.0.0

MeetaliSharma
Level 2
Hi, Can anyone help me to understand why Date Diff is deprecated in Blue Prism latest versions (7.0.0v).
37125.png
3 REPLIES 3

ewilson
Staff
Staff
Hello @Meetali Sharma,

I believe that message about DatDiff being deprecated was added back in Blue Prism v6. I'm not clear on the specifics of why it was added as the underlying DateDiff function of .NET is still alive and well as both a VBA function and a method on the DateAndTime class. 🤷‍♂️

Looking through the online help, you can see that the recommended approach for determining the difference between two dates is to use the MakeDate action. Example:

MakeDate(26,5,1999) – MakeDate(29,5,1968) ' Will return a TimeSpan 11319.00:00:00​

Cheers,
Eric

AndrewPascal
Level 5
Yes, the online help does recommend using date subtraction to return a timespan. That's fine for elapsed seconds, minutes, hours, days or weeks. Unfortunately, it's no good for months, years or calendar weeks - all of which DateDiff() supports. We could certainly use some clarity on whether DateDiff() is going to be removed. If no, why is it deprecated and giving warnings for nothing? If yes, then how are we going to calculate elapsed months in future? Would appreciate some confirmation from the BP Product team.
Thanks,
Andrew Pascal

ewilson
Staff
Staff
Hi @AndrewPascal,

I wouldn't really worry about it. While the pop-up is annoying, it's nothing more than that. There's nothing stopping you from using DateDiff. FWIW, I don't think it will ever be removed as doing so could cause loads of breakage in existing automations in the field. 

Cheers,
Eric