LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Murphy's "Chanchullo de Flanagan"

"Chanchullo de Flanagan": Every constant that Added, Substracted, Multiplied or Divided leads to the correct answer.

I have tried to compare the time values between LabView and Access.

Labview's TimeStamp counts in Seconds from 1904
Access counts in Days from 1900

The operation is simple, but, i have needed 2 extra hours that can't explain.

Could anyone help me, please?

Aitortxo.

P.D. I'm using LabView 7.
Aitortxo.
0 Kudos
Message 1 of 3
(2,833 Views)
The two ours is probably the UTC offset on your computer.

The numeric value of the timestamp produced by LV is the number of seconds since 1904 in GMT. If LV is to produce the local time based on the number of seconds it first finds out what time it equals in GMT and then uses the local computer settings to find out what time that is on that particular computer.

If your are located in west Europe and your computer is set to daylight savings time it is +2 hours compared to GMT. So when you input a time and date the number of seconds is calculated as the time in Greenwich at that same time...two hours less.

That is why you in your particular case have to add 2 hours. If your computer were set to a different time zone it would be something different. To make th
e conversion general you need to find the time offset and add that. You can find a VI that calculates the UTC offset here:

http://www.mooregoodideas.com/Downloads/DateTimeTools.zip
Message 2 of 3
(2,833 Views)
Thank you very much, Mads.

I would never had thought of Local Computer Settings as the reason of my problem.

I hope one day I can write a precise answer like yours. And thanks also for the link to DateTimeTools!!. I have tested the UTC Get Offset VI and, Exactly 2 hours.

Aitortxo.
Aitortxo.
0 Kudos
Message 3 of 3
(2,833 Views)