05-29-2015 04:33 AM
hi,
how to compare 11:30 to 12:00 the two thing is string datatype....i use string to nember converter but it will return only 11.
Solved! Go to Solution.
05-29-2015 05:20 AM
Hi,
11:30 = 11.30 (Replace : by .) then convert in Numeric (use scan from string) and
12:00 = 11.00 (Replace : by .) then convert in Numeric (use scan from string) and can comapre easily
compare minutes if hour value is same otherwise no need.
hope it helps..
-Amit
05-29-2015 05:39 AM
hi,
the scan string also give two seperate number(11:30 mean 11 and 30).
05-29-2015 05:45 AM
The Scan from String function will allow you to parse 11:30 into two integers, 11 and 30. Use the Help for the function to see how it works. Right-click on the function (once you lay it on your Block Diagram to gain access to the Edit Format String option (you'll want to use a format string something like %d:%d). It is up to you to do the arithmetic on minutes and seconds properly (one way is to convert everything to seconds, then subtract).
Bob Schor
05-29-2015 06:26 AM
The easiest way to do this is to format the string in to a timestamp. You can then simply subtract the stamps to tell the number of seconds in between your two timestamps.