Example Code

Calculating the Amount of Elapsed Days Between Two Date Strings

Code and Documents

Attachment

The following two VIs return the amount of elapsed days between two date strings you specify.

Both VIs convert the date strings to timestamps. The VIs use those timestamps to calculate the amount of elapsed days between the two dates.

The Elapsed Days VI uses the Scan From String function to generate the elapsed time. The DateString-Days VI uses the Scan From String function and the Date/Time To Seconds function to return the amount of elapsed days. 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors