LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to compare Date/time string

I read from datalog file including Date/time string ,and want to query the special Date/time string span ,how to compare the data/time string ?
0 Kudos
Message 1 of 5
(7,999 Views)
One way is to convert the date time string to seconds using the Date/Time to seconds vi, then doing straight math.
Greg Bush CLAD
Message 2 of 5
(7,989 Views)
It is a good way ,but I find it must convert the Data/time string to Cluster for the Data/time to seconds.vi!
It is a easy way!So how to improve it better!?
0 Kudos
Message 3 of 5
(7,969 Views)
It is a good way ,but I find it must convert the Data/time string to Cluster for the Data/time to seconds.vi!
It is a not easy way!So how to improve it better!?
0 Kudos
Message 4 of 5
(7,968 Views)
Hello Joshua,

To compare date/time you have to extract the different components (day, month, year, hour, minute, second) anyway. Why not "convert to seconds"? I think it's easier to compare one number (where you also can do other math, like calc the difference and so on) than to compare seven (?) parameters with some exceptions... If the dates are read from excel (there was a similar thread some days ago), why not convert to seconds in excel (just a format change)?

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(7,961 Views)