LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

seconds elapsed since midnight

I am logging data from 3 counters every 1 second. I would also like to add a timestamp with each row (there are 24*60*60 rows). This is redundant, but in case the vi stops or the computer crashes, I can know what time it was. My idea was to record in the first column, the seconds elapsed since midnight. Is there any way to find the seconds elapsed since midnight? Thank you.

KB
0 Kudos
Message 1 of 3
(3,486 Views)
Sure. If you use the Format Date/Time String function with a %H:%M:%S format string, it will return the current time in 24 hour format. Use a Scan From String to get hours, minutes, seconds. Convert hours and minutes to seconds and sum everyting together.
0 Kudos
Message 2 of 3
(3,486 Views)
Another approach is to use the Seconds To Date/Time function. It returns a cluster with day, month, year, hour, minute, and second fields. Then convert hours and minutes to seconds, etc, as mentioned above.
0 Kudos
Message 3 of 3
(3,486 Views)