cancel
Showing results for 
Search instead for 
Did you mean: 

Yesterday's Date and Time

NafizZainal
Level 4

Hi all,

I'm trying to use "get completed items" to get yesterday's completed item from 6.00pm to today at 8.00am. There is a filter that I can use in the action to achieve that and I know to get yesterday's date is "AddDays(Today(), -1)" expression, but what is the expression I can use to add time for yesterday's at 6.00pm and today at 8.00am? 

15849.png

Thanks



------------------------------
Nafiz Zainal
------------------------------
1 BEST ANSWER

Helpful Answers

Mukeshh_k
MVP

Hello Nafiz Zainal,

Function MakeTime(Hours, Minutes, Seconds) in BP gets a time made from given Hours, Minutes and Seconds, for your case it should be like this:

For Yesterday :: AddDays(Today(), -1)&" "&MakeTime(18, 00, 00) and for Today ::  Today()&" "&MakeTime(8, 0, 0), let me know if you have any difficulties implementing this.



------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.

Regards,

Mukesh Kumar - Senior Automation Developer

NHS England, United Kingdom, GB
------------------------------
Regards,

Mukesh Kumar

View answer in original post

6 REPLIES 6

Joshna_16
Level 4

Hi,

Try below to add time:

[Your DateTime Data Item] + MakeTimeSpan(0,1,0,0).

 The parameters represent Day, Hours, Minutes, Seconds.



------------------------------
Joshna Dammala
RPA Developer
Asia/Kolkata
------------------------------

Mukeshh_k
MVP

Hello Nafiz Zainal,

Function MakeTime(Hours, Minutes, Seconds) in BP gets a time made from given Hours, Minutes and Seconds, for your case it should be like this:

For Yesterday :: AddDays(Today(), -1)&" "&MakeTime(18, 00, 00) and for Today ::  Today()&" "&MakeTime(8, 0, 0), let me know if you have any difficulties implementing this.



------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.

Regards,

Mukesh Kumar - Senior Automation Developer

NHS England, United Kingdom, GB
------------------------------
Regards,

Mukesh Kumar

Hello Mukesh, 

Thanks for the answer, it works perfectly! But, I would like to ask if this time generated is in UTC time or Local Time? If yes, then I should add "+(LocalTime()-UTCTime())" to get the Local Time right?



------------------------------
Nafiz Zainal
------------------------------

Hi @NafizZainal

Just to make sure what time zone you are working with Try checking and comparing Now() and UTCTime() separately in Calc for Timezone Confirmation.

However when using Maketime() within an action or process, the resulting time will be in the time zone of the machine where the Blue Prism Runtime Resource is running. This means that if the BP Runtime resource is running on a machine in the UTC time zone, the time returned by Maketime() will be in UTC and similarly by default, the Control Room uses the time zone of the machine where it is installed.

Hope it helps.



------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.

Regards,

Mukesh Kumar - Senior Automation Developer

NHS England, United Kingdom, GB
------------------------------
Regards,

Mukesh Kumar

Hi Nafiz,

I just went through this last week with something.  When you look at the work queue in your BP console, you see things in local time, however they are stored in the database as UTC. When you do "get completed items", it takes the time you send in as UTC and returns you the items from the UTC.  So if you want something from 6 pm - 8 pm local time, do the conversion in advance and send in the UTC time to your "get completed items" action call.  There's a utility called Date/Time Manipulation that has a Local to UTC conversion if you need it.  (At least this was my experience, not sure if that's a configuration item anywhere...)

Good luck!



------------------------------
Diane Sanzone
------------------------------

Hi Diane and Mukesh,

I understand now, really appreciate the clarification from both of you!



------------------------------
Nafiz Zainal
------------------------------