cancel
Showing results for 
Search instead for 
Did you mean: 

FormatDateTime Error

DharmendraGupta
Level 2
Hi Team, I have used FormatDateTime. It is working in development/UAT system but not on production system. I had imported the BP release of the same process in production system. Error : CALCULATION: 'Fetch last run start datetime' Process: 'Process Name' Subsheet: 'Fetch run timings' ERROR: Internal : Failed to evaluate expression 'FormatDateTime([Last run start datetime]; "MM/dd/yyyy HH:mm:ss")' - FormatDateTime function requires 2 arguments of types: (datetime,text)
5 REPLIES 5

NicholasBell1
Level 3
Do the logs show what the value of [Last run start datetime] was?

RanjeetPatel1
Level 3
Hi Dharmendra   It seems your variable value at run time is null , hence the expression evaluation fails. Check the run time value in logs.   Regards Ranjeet

DharmendraGupta
Level 2
Hi Team, In both env i am getting same value for [Last run start datetime] ie ""9/27/2018 11:45:00"" and with Text datatype. In UAT below expression working as expected and returns ""09/27/2018 11:45:00"" But in Prod if [Last run start datetime] is ""27/9/2018 11:45:00"" then only expression returns ""09/27/2018 11:45:00"" else throws same error. FormatDateTime([Last run start datetime], ""MM/dd/yyyy HH:mm:ss"")   It got resolved last time after changes in region and dattime setting.

John__Carter
Staff
Staff
This might help https://portal.blueprism.com/documents/v6-data-sheet-date-and-time-hand…

EVIPUTI
MVP
@Dharmendra Gupta The problem is that the first argument should be in the format date (or a text which can be converted to date).
It depends on the format of your computer system. Seems your prod is following some other format of date and thats why when BP is trying to convert its failing . Simply  swap the day with the month and then you can use the FormatDate function.

------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification and Optimization Designer(Solutions Architect)
Fidelity International
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------