Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Property DateTime Format

Solved!
Go to solution

So I am trying to set a property in my TDMS file.

_waveformChannels[i].GetProperty("wf_start_time").SetValue<DateTime>( ... );

 I checked while debugging. The DateTime object I want to write has the correct timing information. After I Write it with the line above it gets corrupted. The "wf_start_time" field in the finished file is always 2 hours off. Also I would like to force a 24 hour format like

"MM.DD.yyyy HH:mm:ss.fff"

 

Right now I am out of options. I didnt find something about it in the docs.

 

Greetings

Rizardus

 

0 Kudos
Message 1 of 3
(3,077 Views)
Solution
Accepted by topic author rizardus

Hello Rizardus!

I assume that your timestamps are off by exactly 2 hours. This is because timestamps in TDMS files are always written in UTC. That way you won't run into trouble in case you have a measurement running while e.g. the local time zone switches between summer and winter time or a user changes the computer's local time zone.

+2 hour difference to UTC would match e.g. most of Western Europe.

 

Here is a forum thread that explains is a bit more in detail: TDMS: wf_start_time and time zone

 

 

 

Regarding the time format: Where do you see the 12h format? The tdms file itself is binary, so you are probably not looking at it directly using a hex editor. Are you seeing the 12h format on your application's UI? Or are you opening the tdms file with a tool, e.g. the Excel Addon? The format shown depends on the tool itself, not the tdms file.

Except you write the datetime into a string property; in that case you could use your languages function to format strings to convert datetime to a string in the format you need it. See Using Elapsed Time Formats with Measurement Studio Windows Forms Controls starting from section How Do I Create a Custom Elapsed Time Format? for some examples.

 


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 2 of 3
(2,979 Views)

I converted TDMS to ASCII in my own application. Thanks I will check the formatting in the string there.

0 Kudos
Message 3 of 3
(2,928 Views)