Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66786

Timestamp always converted to UTC?

$
0
0

 

In applying the "Get Date/Time" function and "Date/Time to seconds", it looks like they force UTC after conversion, even if the option for UTC is FALSE.

 

I would like to have the actual system date and time available (that accounts for DST and timezone as shown on my PC)  at the timestamp output, but instead I keep getting a value for the timestamp that (I assume) is UTC. When I probe the timestamp output, or the cluster output, it looks correct. However upon evaluating the timestamp number, it is always off by what looks like the DST and timezone difference (exactly 5 hours).

 

I have tried two  different methods and find the same results;

1) Output of "Get Date/Time" function directly (which states the timestamp will be Universal Time in its contextual help file)

and

2) Converting the timestamp to a cluster and reconverting it timestamp (as shown in picture).

 

In the example picture attached, notice that the cluster output (Probe 25) shows the correct hour (16) when broken down and the timestamp probe (Probe 26) looks correct.

 

However, when the timestamp of either the "Get Date/Time" function or the "Date/Time to seconds" function is converted to U32, the time changes to what looks like UTC time as the timestamp 3485539686 (Probe 28) has the 5 hour offset (21 hours as shown in the Excell sheet calculations included in the picture).

 

I do not want to simply subtract 18,000 seconds to account for this difference (as changes in DST or timezone could cause problems). I would like the actual PC time to be used for the array build.

 

How can I do this?

Why do the probe points show the correct system time, but right after timestamp is coverted to U32 it looks like UTC?

 

 

 


Viewing all articles
Browse latest Browse all 66786

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>