To download NI software, including the products shown below, visit ni.com/downloads.
This example is used to convert a date and time string back into a timestamp.
It's common to convert timestamps to strings when writing data to a file, and there are a number of native LabVIEW functions that allow you to do so (Get Date/Time String VI, Format Date/Time String VI). However, if you need to convert a date and time string back into a timestamp, there is no built-in function in LabVIEW to do so! There are good reasons to do this, such as reading data from an old logfile and plotting it onto a LabVIEW Graph. If you want time on the x-axis, you're currently a little out of luck since you can't use Date/Time strings to define the x-axis.
Attached is a solution which allows one to take a Date String and Time String (formatted per the outputs of the Get Date/Time String VI), and create a Timestamp. It makes a few extra conversions, and is meant to be modified to fit your application's specific use case.
Steps to Implement or Execute Code
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.