george seifert Posted March 18, 2013 Report Share Posted March 18, 2013 I'm trying to store time stamp data in a configuration file, but am not having much luck. I noticed there is a time stamp data type, but can't figure out how to store it directly in the ini file. As a backup I tried converting the timestamp to a double first, but I keep losing digits that way. It won't store the full precision in the ini file. Any ideas? Thanks, George Quote Link to comment
Phillip Brooks Posted March 18, 2013 Report Share Posted March 18, 2013 (edited) You should be able to use the "format into string" and "scan from string" functions to store a human readable timestamp in an INI file with considerable accuracy. Try this format string: %^<%Y-%m-%dT%H:%M:%S%16uZ>T modify the 16u portion to set the fractional seconds. ISO-8601 Persistent Timestamp.vi LabVIEW's 128 bit timestamp is accurate to 0.05421010862427522170... attoseconds http://www.ni.com/white-paper/7900/en Edited March 18, 2013 by Phillip Brooks 1 Quote Link to comment
GregSands Posted March 18, 2013 Report Share Posted March 18, 2013 LabVIEW's 128 bit timestamp is accurate to 0.05421010862427522170... attoseconds http://www.ni.com/white-paper/7900/en Accurate. You keep using that word. I do think it means what you think it means. Precise, sure, but accurate, no. Not yet anyway. Of interest, why do the fractional seconds truncate rather than round? If using the format in your signature (%3u) I get 2013-03-18T20:40:36.8988289833068847Z current time 2013-03-18T20:40:36.898Z formatted time 1 Quote Link to comment
Phillip Brooks Posted March 18, 2013 Report Share Posted March 18, 2013 You be careful. Timestamps with masks cannot be trusted. Quote Link to comment
Popular Post JackDunaway Posted March 19, 2013 Popular Post Report Share Posted March 19, 2013 Of interest, why do the fractional seconds truncate rather than round? If using the format in your signature (%3u) I get2013-03-18T20:40:36.8988289833068847Z current time 2013-03-18T20:40:36.898Z formatted time Well, it depends. At what speed were you, the observer, traveling with respect to the execution speed of the block diagram? 4 Quote Link to comment
Bjarne Joergensen Posted March 19, 2013 Report Share Posted March 19, 2013 What about this solution /Bjarne Quote Link to comment
Phillip Brooks Posted March 20, 2013 Report Share Posted March 20, 2013 Well, it depends. At what speed were you, the observer, traveling with respect to the execution speed of the block diagram? There's an African Swallow joke in there somewhere... Quote Link to comment
george seifert Posted March 20, 2013 Author Report Share Posted March 20, 2013 t was easier than I thought. Quote Link to comment
JackDunaway Posted March 20, 2013 Report Share Posted March 20, 2013 t was easier than I thought. Replace your format specifier with the one linked by Philip Brooks for ISO-8601 and XKCD compliance. http://xkcd.com/1179/ 1 Quote Link to comment
GregFreeman Posted March 20, 2013 Report Share Posted March 20, 2013 Replace your format specifier with the one linked by Philip Brooks for ISO-8601 and XKCD compliance. http://xkcd.com/1179/ I believe this also makes them ascii sortable by date Quote Link to comment
Ton Plomp Posted March 22, 2013 Report Share Posted March 22, 2013 I love that we are in 2013 now, makes it easier to spot the year digits. And definitely use 8601 compliant timestamps. Ton Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.