12-18-2010 07:30 PM
Hi All,
A minor query about time stamps and scan from string. I needed to convert a string back to a timestamp and found the solution I needed at this post: Link
I wanted to make it a little more programatic and noticed that when I assembled the formatting string it would not recognise the assembled output as a Timestamp - it outputted a double. The strings inputs are identical. The double precision output converted to a Timestamp to give the correct value - so I have a work around.
I was just curious if this is a minor issue with LabVIEW or is this an intentional feature? Or is there some step I'm missing to coerce my output to a Timestamp.
Thanks,
Dave
Solved! Go to Solution.
12-18-2010 07:46 PM
When you wire a string constant to Scan From String, the function can auto-adapt to the input and you get the proper output automatically. With a programmatically generated format string you need to use the Default Value input (circle with the dot) which defaults to DBL. Just wire a Timestamp constant, or the current time, to that input.
12-18-2010 07:49 PM
That explains it - thank you,
Dave
05-03-2013 07:25 AM - edited 05-03-2013 07:27 AM
I convert a string to a double represented as a timestamp. The strange is that it converts wrong, if I wire a 'NaN' to the default value. Look inside the code..
(LabVIEW 2010 SP1)
05-03-2013 07:59 AM