To calculate the time difference between two dates in weeks, days, hours, and/or minutes:
Use the Format into String VI1. Place Format into String VI on the block diagram
2. Right click the "resulting string" output of the Format into String VI and select Create > Indicator.
3. Place two Time Stamp Constants and one Subtract Function on the block diagram. Connect as shown in the example below. In this example, the Elasped Time = Comparison Date - Reference Date.
4. Lastly, place a String Constant on the block diagram and connect it to the Format into String VI through the "format string" terminal as shown below. You can customize the string format based on your needs by using the
Time Stamp Format Codes.
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.