LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is an absolute time of 0 s stored as -57600?

I created a numeric control (type double) and formatted it to appear as absolute time (HH:MM:SS).  The value in the variable corresponding to time 00:00:00 is -57600.  (57600 corresponds exactly to 16 hours)
 
I can easily correct for this by subtracting -57600, but I'm curious about why the value is stored this way.
 
S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 1 of 4
(2,642 Views)
It depends on your timezone setting. Try to set your computer to GMT and see if things improve. 😉
Message 2 of 4
(2,639 Views)
You're absolutely right, Altenbach.
 
In order to ensure that my application works across timezones, I changed my code to subtract a constant absolute time of 00:00:00 (instead of -57600).
S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 3 of 4
(2,627 Views)
"I changed my code to subtract a constant absolute time of 00:00:00 (instead of -57600)."
 
Gotcha Warning:
 
I do not now about the rest of the world but here in the US there is "Day Light Savings Time" which can complicate using constants with time values.
 
I strongly urge you to test your code to ensure it works correctly under both DST and non-DST. This can be done by changing the system time on your machine to dates when the current DST setting isnot in effect.
 
Ben
 
PS Christian, You just have 7 more to go! I will try very hard not to post anymore than I absolutely have to.

Message Edited by Ben on 09-13-2006 02:19 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(2,619 Views)