cancel
Showing results for 
Search instead for 
Did you mean: 

Defer Time Miscalculating?

RobertWertz
Level 2
I'm currently working through the Defer portion of section 9. When I use

ToDateTime(Today() & " " & LocalTime() + MakeTimeSpan(0,0,5,0))

I receive the wrong value. When I check the Defer time in the Control panel, I see a time five minutes ahead, but five hours ago. When I hit Evaluate Expression in the Expression Chooser it gives me the correct time, so I have no idea why Defer is appearing as five hours ago. The other DateTimes in the Control panel are the correct times, so I don't think it's a timezone issue or anything.

------------------------------
Robert Wertz
------------------------------
4 REPLIES 4

MattPalmer
Level 5
I believe the Defer time is calculated in UTC time which is probably why your seeing the 5 hours ago issue when you use your LocalTime().  In one of my processes where I use Defer, I calculate it by using Now() + [Hours to Defer] where [Hours to Defer] is a time span = 0.04:00:00 hours.  You'll find for a lot of the time calculations in Blueprism you'll need to use UTC time as your anchor point.

------------------------------
Matt Palmer
Business Process Specialist
Chesapeake Energy
America/Chicago
------------------------------

That was my first thought too. The fact that pressing "evaluate expression" returns the proper value is what confuses me. Plus, when I use LocalTime() in the summary field it correctly identifies the time. It's just weird that Defer is the only one of these that seems to be set in UTC and then converted back to EDT.

------------------------------
Robert Wertz
------------------------------

When you calculate the Time expression using evaluate : It shows you the result in local time as per your PC TZ. However, BP stores everything in the DB in UTC TZ and thats why in control panel you would be able to see the Time in UTC (Which may be 5 hours as per your point.)

------------------------------
Vivek Goel
RPA Architect
Asia/Singapore
+6594554364
https://www.rpatools.com/
------------------------------

Came to forums to find the answer to this question - the fact that the time didn't match the evaluate value was also my main confusion! 
Thank you from two years in the future 🙂 

-Colleen

------------------------------
Colleen DiVincenzo
------------------------------