C CidTek Active Member Licensed User Longtime User May 8, 2013 #1 I need to test if time1 is >= time2 where both times are hours and minutes only (24 hour clock). eg: 13:02 A simple string comparison which works with other languages is giving me an error so it looks like I have to treat the strings as times not strings. What is the best fuction to use in this situation? Edit: To further complicate this I have to treat 1am to 3am as 25:00 to 27:00 because in transit databases they are considered part of the previous day since schedules for Saturday can be different than friday for instance. So really I need some sort of string comparison since date/time functions would not like my extended day times. Last edited: May 8, 2013
I need to test if time1 is >= time2 where both times are hours and minutes only (24 hour clock). eg: 13:02 A simple string comparison which works with other languages is giving me an error so it looks like I have to treat the strings as times not strings. What is the best fuction to use in this situation? Edit: To further complicate this I have to treat 1am to 3am as 25:00 to 27:00 because in transit databases they are considered part of the previous day since schedules for Saturday can be different than friday for instance. So really I need some sort of string comparison since date/time functions would not like my extended day times.
Erel B4X founder Staff member Licensed User Longtime User May 8, 2013 #2 You can use String.Compare to compare two strings. Upvote 0
C CidTek Active Member Licensed User Longtime User May 8, 2013 #3 Erel said: You can use String.Compare to compare two strings. Click to expand... Thanks for pointing me in that direction. I found "String.CompareTo" which I'm sure that's what you meant. Works perfect for my purposes. Upvote 0
Erel said: You can use String.Compare to compare two strings. Click to expand... Thanks for pointing me in that direction. I found "String.CompareTo" which I'm sure that's what you meant. Works perfect for my purposes.