LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

EPOC time

Using CVIAbsoluteTimeFromFILETIME() keeps everything UTC and avoids offsets due to timezone and daylight savings

 

CVIAbsoluteTime now, epoch;
CVITimeInterval difference;
double TimeFromEpoch;
FILETIME fileTimeEpoc;
const long long ll = 116444736000000000;
fileTimeEpoc.dwLowDateTime = (DWORD)ll;
fileTimeEpoc.dwHighDateTime = ll >> 32;
CVIAbsoluteTimeFromFILETIME (fileTimeEpoc, &epoch);

GetCurrentCVIAbsoluteTime (&now);
SubtractCVIAbsoluteTimes (now, epoch, &difference);
CVITimeIntervalToSeconds (difference, &TimeFromEpoch);
Message 11 of 11
(547 Views)