cancel
Showing results for 
Search instead for 
Did you mean: 

How to Check if DateTime is empty

se61qoku
Level 3
Calculation formula to check for empty DateTime variable:
InStr(Trim([dateTime]); "01.01.0001")=0  

Empty DateTime variable in Blue Prism results in "01.01.0001 00:00:00" which corresponds to value of Field DateTime.MinValue: DateTime.MinValue Field (System)
Microsoft remove preview
DateTime.MinValue Field (System)
public: static initonly DateTime MinValue; public static readonly DateTime MinValue; staticval mutable MinValue : DateTime Public Shared ReadOnly MinValue As DateTime Field Value The following example instantiates a DateTime object by passing its constructor an Int64 value that represents a number of ticks.
View this on Microsoft >
#BPTechTips


------------------------------
Stephan Knoell
Senior Developer
Roboyo
Munich
------------------------------
1 BEST ANSWER

Helpful Answers

Satish1414
Level 4
Hi Stephan ,
You can use IsDate() and IsDateTime() expression to validate the Dates .It would return a flag of true/False . 

22515.png
Hope this helps .

Thanks ,
Satish Gunturi
Senior Consultant
Ignite IPA Pvt Ltd

------------------------------
Satish Gunturi
------------------------------

View answer in original post

4 REPLIES 4

Satish1414
Level 4
Hi Stephan ,
You can use IsDate() and IsDateTime() expression to validate the Dates .It would return a flag of true/False . 

22515.png
Hope this helps .

Thanks ,
Satish Gunturi
Senior Consultant
Ignite IPA Pvt Ltd

------------------------------
Satish Gunturi
------------------------------

Hi Satish,

thats an even better way. Thanks!

Best,
Stephan

------------------------------
Stephan Knoell
Senior Developer
Roboyo
Munich
------------------------------

Adding reference for a similar thread for future references.


------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------

AmolJangam
Level 3

Hi Stephan,

Above scenario will not help when you have date or datetime data item.

Would suggest creating an action in Object "Utility - Date and Time Manipulation" with name "DefaultDate", Input for code stage will be the date data item "inputDate" and Output as isDate a flag data item:

isDate = True
if inputDate = nothing
isDate = False
End if

if your element holds date then isDate will be True and if blank date is provided then flag isDate will be False.

Thanks,

Amol Ashok Jangam

Lead Consultant

Infosys.