Jump to content

Store time stamp data in configuration file?


Recommended Posts

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

Link to comment

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 by Phillip Brooks
  • Like 1
Link to comment
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

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.