LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate UTC with NI routines?

Using the National Instrument time() routine how do you calculate the UTC? We need the time to be
in seconds since 1970 but the routine seems to pass back seconds since 1990.
0 Kudos
Message 1 of 2
(3,283 Views)
CVI's time() implementation does return UTC but its timebase is January 1, 1900 (the ANSI C standard doesnt not specify a fixed timebase for time functions). To convert this to January 1, 1970 you would need to offset the value returned by time() by -2208988800 (the number of seconds between Jan. 1 1970 and Jan. 1 1900).

Regards,

Alex
Message 2 of 2
(3,261 Views)