ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time changes when sent via shared variable

I am trying to send time data to a client PC using a network published shared variable.  I read the time data from the host PC via the Get Date/Time In Seconds Function then use the Type Cast Function to convert the time to a SGL 1D array. The data associated with the time is already in a SGL 1D array.  I use the Build Array Function to combine time and data and then write the new SGL 1D array to a network published shared variable on the host side.  On the client side I split the array to separate the time and data and use the Type Cast Function to create a timestamp to display.  The time displayed is exactly 7 hours off from the host.  Minutes, seconds, and date are correct only the hours are wrong.  I do not have this problem if I do the same process on the host PC.  Any ideas why?
0 Kudos
Message 1 of 2
(2,611 Views)

I bet you are in either the Mountain Time Zone of Pacific Time Zone.  Not sure, and too lazy to look it up.

 

 

My hypothesis:

 

Somewhere, your software is interpreting the local time as UTC or vice versa.

 

Solution:

 

Make sure you are always in UTC and add the correct amount for the time zone or something like that.

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 2
(2,601 Views)