LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with calculating elapsed time based on timestamp

Hey guys,

 

I'm sure this isn't too hard of a function to pull off, but I haven't been able to find a way to do this so far. I would like for the front panel of my VI to have a timestamp input (like pictured below), and using that input I would like to calculate how many minutes has passed. (using current date/time from computer)

 

The conversion to time needs to be in minutes, so the seconds that have passed aren't too necessary (although some kind of .XX value from it wouldn't be bad)

 

If anyone can guide me in the right direction that would be greatly appreciated!

 

Thanks!

0 Kudos
Message 1 of 3
(4,106 Views)

Have you tried to convert the Timestamp datatype to Double ? (use the numeric conversion palette that is in the numeric palette)

This will give you the number of seconds that passed since some reference timestamp (I think Jan 1st in 1904).

You can also convert the Current Timestamp to double and subtract the converted user input to get the number of seconds elapsed.

 

I can send you an example if you won't succeed.

(I am infront of  a LabVIEW-less pc now 😕 )

0 Kudos
Message 2 of 3
(4,097 Views)

If you subtract a timestamp from another timestamp, you will get a double that represents the difference in seconds between the two.

 

A double indicator can be customized to show relative time. This can show you the hours, minutes and seconds.

 

 

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 3 of 3
(4,065 Views)