DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

incorrect time conversion

I have created a time stamp channel with LabWindows that I write to a TDMS file. The time is a double and is returned from GetCurrDateTime(&curr_time) which returns the number of seconds since midnight, January 1, 1900 . I write the time to the TDMS file as a double as well.
In Diadem 10.1, the converted time string returned from RTT looks like this:
 
4/27/0107 15:36:05.531 from 3386590565.531 num_seconds
 
Using LabWindows FormatDateTimeString() the converted time looks like this:
 
4/26/2007 15:36:05.531 from 3386590565.531 num_seconds
 
I can change the display format in the the portal from numeric to time and also in view and I still get the incorrect date information but I'm guessing changing these attributes makes a call to the RTT function.
 
 
0 Kudos
Message 1 of 3
(3,207 Views)
Hello skilagig,

I think the problem happens because DIAdem calculates the time in seconds beginning in the year 0. So if you add the number of seconds from 0 up to 01.01.1900 (which is 5.9958144E+10) the Time is OK.

RTT(3386590565.531 + 5.9958144E+10) ==>>> 4/26/2007 15:36:05.531

Greetings
Walter
Message 2 of 3
(3,193 Views)
Cheers Walter,
0 Kudos
Message 3 of 3
(3,185 Views)