Sunday, January 22, 2017

Epochs, Leap Seconds, TAI, UTC, Labview, Diadem, Matlab

Quick Reference


Diadem time = labviewDBL + 60084270000 (four zero's) [seconds]

Matlab time [s] = diadem + 172800s << >> diadem = matlab[days]*24*3600 +2*24*3600s

Matlab time [days] = labviewDBL+60084270000 + (2*24*3600)




2017/01/22 8am (includes leapseconds, i.e. these are UTC)

Diadem: 6.36522048e10 seconds (LV saving to .tdms)

Labview: 3.5679348e9 seconds (LV timestamp passed through "to DBL")

Matlab: 7.367173333333334e5 [days] (datenum(2017,01,22,8,0,0) datestr(DateNumber)

Matlab: 6.365237760000000e10 [seconds]


General References
http://www.leapsecond.com/java/gpsclock.htm
https://www.timeanddate.com/time/leapseconds.html

Epochs
Matlab: 0-Jan-0000 (https://www.mathworks.com/help/matlab/ref/cdfepoch.html )
Diadem: 01.01.0000 at 00:00:00 (Omar: http://forums.ni.com/t5/DIAdem/Date-and-Time-channels-in-Diadem-files/m-p/41403?query.id=426312#M26 )
Labview: 01/01/1904 00:00:00.00 UTC (http://www.ni.com/tutorial/7900/en/)
Unix: 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970 [wikipedia]
GPS: January 6th, 1980
TAI:

Software numerical representations
Matlab: whole and fractional number of days from 0-Jan-0000 (https://www.mathworks.com/help/matlab/ref/cdfepoch.html )

Internal file formats:
TDMS:  http://www.ni.com/white-paper/5696/en/

Example 1:
Source: Labview DAQ storing 1588 PTP
Destination: Matlab + Diadem
Necessity to sync with UTC: no

Suppose data is taken at 2017/01/22 8:00am EST stored in a .tdm or .tdms file using a Labview based DAQ System using timestamps from an IEEE 1588 PTP timing card using NI Sync blockset.