LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

epoch time calculate

hi,

      how to calculate epoch time in current time stamp based(in 1970 jan 12:00 clock time based)

0 Kudos
Message 1 of 8
(4,073 Views)

Hi Gokul,

 

to get the number of seconds since 01.01.1970 yu just subtract that timestamp from current time…

 

Does this answer your question?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,054 Views)

hi,

       but i can't set 00:00:00 1/1/1970 in constant variable.here attached my exampe.if i set 12:00:00 1/1/1970 it give some second difference value show.

0 Kudos
Message 3 of 8
(4,037 Views)

Hi Gokul,

 

why can't you set 00:00:00 in your timestamp?

 

I can:

check.png

Be aware of the timezone dependency of the timestamp control/constant!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(4,028 Views)

hi,

      i try to change(00:00:00:000 1/1/1970) it automatically change 5:29:59:000 1/1/1970

0 Kudos
Message 5 of 8
(4,015 Views)

What happens when you input "31.12.1969 18:30:00"?

Again: this is related to the mentioned timezone dependency of the timestamp in LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,992 Views)
 

The difference between Y1970 and Y1904 is 2082844800 seconds regardless of time zone. Since the "Get Date/Time In Seconds" VI is UTC, then the output UNIXEpochTime is also in UTC. Ensure that the U32 representation is used to avoid the Y2038 problem.

UNIXEpochTime.jpg

0 Kudos
Message 7 of 8
(2,806 Views)

Here's something that might help, I found this a long time ago when trying to convert LabVIEW raw timestamp to an "Excel" Timestamp

 

The OLE (Excel) date format is a double-precision floating point number that counts the time from 30 December 1899 00:00:00.

Thus, a value of 0.0 corresponds to 30 December 1899 00:00:00.

 

The UTC date that is returned from the LabVIEW functions is the number of seconds elapsed since 12:00 a.m., Friday, January 1, 1904.

Thus, in this case, a value of 0.0 corresponds to 01 January 1904 00:00:00.

 

This means you have an offset between a LabVIEW timestamp and the OLE date.

 

Basically, whatever date you get from LabVIEW you need to add the number of seconds between 30 December 1899 00:00:00 and 01 January 1904 00:00:00 to get the corresponding OLE date value in floating point.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 8
(2,800 Views)