15-03-23 07:17 AM
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?
Thanks
Answered! Go to Answer.
15-03-23 08:29 AM
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.
15-03-23 08:26 AM
Hi,
Try below to add time:
[Your DateTime Data Item] + MakeTimeSpan(0,1,0,0).
The parameters represent Day, Hours, Minutes, Seconds.
15-03-23 08:29 AM
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.
15-03-23 09:30 AM
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?
15-03-23 09:46 AM
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.
15-03-23 12:31 PM
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!
16-03-23 04:03 AM
Hi Diane and Mukesh,
I understand now, really appreciate the clarification from both of you!