LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

~7 Hours off when calculating time since Jan. 1 1970

Hey Everyone, I need to calculate the time in seconds since 1970. In looking around on the posts I tried using methods others had suggested but I am getting a result that is off by about 7 hours when I campare it to websites that calculate the time.
 
I am using the Get Date/Time in Seconds vi and then subtracting from that a timestamp for 12:00:00 AM 1/1/1907. But as I said, my result is off by about 25200 seconds, or 7 hours.
 
I attached a snapshot of my code. Does anyone know why this could be happening? Or know of a better way to get this?
 
Thanks,

Paul
0 Kudos
Message 1 of 4
(3,063 Views)
what are the chances it is 7am there? or the chances that you are at GMT+/-7 (Mountain time)? 
0 Kudos
Message 2 of 4
(3,055 Views)

Oh, Get Date/Time gets time in UTC. I am in the Mountain Time Zone so that explains the 7 hour difference. Guess I just need to add that to my calculated time and i should be good. Thanks, I feel kinda stupid now.....but thats the way to learn sometimes.Smiley Very Happy

 

Paul

0 Kudos
Message 3 of 4
(3,050 Views)

It sounds like a time zone correction is coming in somewhere. Are you in a -7hr (or +7hr) zone? I think that's Mountain zone in USA.

Are you interested in the number of seconds since your specified time GMT, or the number of seconds since the specified time in your time zone. I would guess that the website is showing one of these options, and LabVIEW the other one.

For instance, I am in GMT time zone, and your code telle me that it is now 1205511555 seconds 01 /01/1970 00:00:00 (Now = approx 16:19 GMT)

Put the time zone display on your time constant, and you will see what difference you are measuring. (Properties -> Format and precisiopn -> Display Time Zone)

 

Rod.

 

0 Kudos
Message 4 of 4
(3,047 Views)