LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I build a timestamp?

I have files that have been given filenames that include the year, month, day, hour, min, sec, msec that they were created. The filenames were generated from a timestamp and a format string, I need the inverse function. How can I recreate the original timestamp with a format string and the values I have available.

I've tried numerically computing the timestamp with the number to timestamp VI, however I can't figure out how labview handles leap years/seconds or some other unknown factor that prohibits me from regenerating the original timestamp.
0 Kudos
Message 1 of 3
(4,546 Views)
You need to use Scan From String to get the various parts and then wire that data to the input cluster of Date/Time to Seconds. The attached example shows this. If the structure of your filename is different, you can simply change the format string to match what you have.
Message 2 of 3
(4,546 Views)
thanks, I had assumed the date/time to timestamp VI took a timestamp as an input since it was a similar brown wire going in, and had been cursing NI all day for not providing such a VI =D much much simpler than trying to numerically compute it
0 Kudos
Message 3 of 3
(4,546 Views)