cancel
Showing results for 
Search instead for 
Did you mean: 

Date and time check

WillemNel
Level 3
Good Day

Just wondering if their is anyone that will be able to assist.Still a bit new to developing.
I need to do a date and time check in a process.
I need to check if the date and time if older that 48 hours excluding weekends and public holidays and if so the process should go on and if the not it should have an business exception.
So I have the collection that has the date and time on it as a data item and will use the date of the specific date the process will run as my start date.
For example:
21/01/2020 07:55am (Today - Tuesday) now I need to check if the date and time on the collection items date and time is 48Hours ago.
Date items details as follow one is 20/01/2020 08:00am (Monday) and should be exception and the other one is 17/01/2020 09:00am (Friday) and should also be exception as the weekend must be excluded and the last data item is the 16/01/2020 07:30am and the process should continue as more that 48Hours.

Thanks


------------------------------
Willem Nel
------------------------------
3 REPLIES 3

Sven_StienWullu
Level 4
​Hi Willem!

Try this one in a decision stage:

Now()-ToDateTime("22.01.2020 08:00:00")>MakeTimeSpan(2; 0; 0; 0)

Subtracting DateTimes leaves you with a TimeSpan, it's explained more in depth in the Functions area inside the decision/calculation-stages.
Just substitute "22.01.2020...." with the dates and times in your collection.

------------------------------
Sven Stien Wullum
RPA-developer
Fremtind
Europe/Oslo
------------------------------

​For the weekend check, use an action stage from the Calendars object, "Is weekend" or even "Is workday" if you want to exclude bank holidays and such too.
Remember you have to have a calendar defined in the System-tab in the main Blue Prism window, just scroll all the way down and you should see it.

------------------------------
Sven Stien Wullum
RPA-developer
Fremtind
Europe/Oslo
------------------------------

Thank a lot.
Will give it a go and advise.

------------------------------
Willem Nel
------------------------------