NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert into time format from Seconds() function

I used the seconds() function to get the time when I ran the TestStand sequence. How do I convert this number of seconds into a hr:min:sec format?

0 Kudos
Message 1 of 5
(4,178 Views)

Hi sportsguy99

Does Time() give you what you need?

Steve

0 Kudos
Message 2 of 5
(4,137 Views)

Yes, but I have another question. I have data coming from the Time() function and it says the date of 6/1/2017 and the other date I get from a program into a CSV file which I cannot change the format of and it returns a date of 06/01/2017. I try to put a IF statement and have one test if it is less than or equal to, but the 06 is always less than even if they are the same date since the 0 in front. How do I fix this issue? Or is there another way to convert it to work?

0 Kudos
Message 3 of 5
(4,129 Views)

Hello sportsguy99, could you check this example? Here output date is formatted to "04.06.2017 18:25:09" format. Thus, you can compare dates, as they'll have the same length.

 

Sincerely, kosist90

 

logos_middle.jpg

 

Check out new feature of LabVIEW 2017!

0 Kudos
Message 4 of 5
(4,108 Views)

You can use the 2nd parameter of the Str function which set the format of display of the 1st parameter of the function

 

For example : format ' Str(Locals.Month,"%02d") ' will display the Locals.Month variable with at least 2 digits, adding a zero before if necessary

 

Regards

0 Kudos
Message 5 of 5
(4,104 Views)