LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI to convert LabVIEW time to Unix time

The difference you see is because your sbRIO target uses UTC time and your desktop uses local timezone. There is no simple solution to fix that since VxWorks has limited support for timezone settings. Easiest is to only work in absolute timestamps on the RIO platform, since that value is ALWAYS in UTC. Once you convert an absolute timestamp to a display form of any kind, this applies the timezone offset of the system, which for a desktop computer is usually the local timezone offset and for realtime targets is 0 since they normally operate with UTC.
Message Edited by rolfk on 04-09-2010 05:28 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 11 of 14
(4,639 Views)

Tanks for reply !

 

But sbRIO work with UTC ( 2010/04/09 07:22:33 ) and my localtime is CET=(UTC + 1h) or CEST=(UTC + 2h)  ( PC: 2010/04/09 16:22:33 CEST).

I have 8 or 9 hours of difference !!! 

I do not understand, I would expect a difference in the 1 or 2 hours.

 

md71

Message Edited by md71 on 04-09-2010 11:03 AM
0 Kudos
Message 12 of 14
(4,625 Views)
Then the RTC in your sbRIO has not been set correctly! Not sure if MAX supports to change RIO time, but there is a VI in the palettes that allows reading and setting the time for real-time targets. You can write a VI that runs on the realtime target and uses those VIs and either execute it interactively or somehow integrate it in your remote control protocol if you have one implemented for your realtime app.
Rolf Kalbermatter
My Blog
0 Kudos
Message 13 of 14
(4,605 Views)

The difference in seconds betwwen the two appears to be 2,082,862,800 seconds.  Subtract or add depending on which way you are converting.

-Scott
0 Kudos
Message 14 of 14
(3,221 Views)