cancel
Showing results for 
Search instead for 
Did you mean: 

Difference Now(), LocalTime(), DateTime Queue

JanPiwowarski
Level 4
Hi, can someone explain to me what are the differences between the functions Now() and LocalTime() and where the return values come from? I've set the right UTC Timezone in Windows, taskbar shows the right time, but now() returns one hour less, LocalTime() the same problem. (BP v5.018) Another Problem is Format DateTime in all Queries for object Work Queues. For example, i see in the log that an item is marked as completed at 07:01:20, if i call get completed items with calculated current time (for example 07:01:30) as EndTime i get no results. The problem is that the seconds are rounded off automatically or only full minutes are viewed. Here i see in the log that all items that are marked as completed are searched until 07:01:00. Is'nt it a bug? Please help. Thanks in advance.
9 REPLIES 9

DexterWhelan1
Level 4
Now() is a date time and LocalTime() is time only. Also the discrepancy in time might come from the time your server/DB is set to. Not uncommon for them to be set differently due to timezones.

Graeme__Tacon
Level 6
Now() gives back UTC time, LocalTime() gives back local time

MarcoWagner
Level 2
Does Now() always return UTC time, irrespective of timezone set on the server/DB?

CrisantoPaet
Level 2
Hi I am experiencing the same error where I cannot extract the seconds part of the LocalTime()   LocalTime() = 7:20:23 PM but if placed in a Data Item would result in 7:20 PM. Even the FormatDateTime cannot handle this. I even tried the Replace() text function but still not working.

ChristianLerch
Level 3
Same issue here: LocalTime() results in 19:45 instead of 19:45:16, the part for seconds is missing. Why?

Hitesh__Mhatre
Level 4
When LocalTime() result is stored in text in converts to HH:MM format. If you need Seconds also use Utility - Date and Time Manipulation VBO where you will find Get Time of Day Action. Keep ""Use UTC"" Parameter False and you will get current time with seconds.   Note: Data type of output result is Time Span, you can directly put Text Data type variable to get result into text     I hope this may help you.

HustonLopes
Level 2
This looks more like a bug. Seconds are required for calculations. So should be ideally available in LocalTime(). When LocalTime() is saved in a Time Variable, we get seconds. But not in other variable types.

AlesKmunicek
Level 2
We also experience problems with LocalTime(). On some virtual clients, LocalTime() returns different time than clock (e.g. LocalTimer = 3 PM and clock = 6 PM). Any idea what could be the cause ?

david.l.morris
Level 15
Hi Ales, Could you take a screenshot of that happened on one of the virtual clients? I've never seen that occur and I'd like to know for sure if that is possible. Respectfully, Dave

Dave Morris, 3Ci at Southern Company