How can i get time like "11:30" formate so that i want to compare it with the following:
strOpenTime = @"10:00";
strCloseTime = @"2:00";
so how can i get current time like as above open/close time format and i want if the current time is inside the interval open/close time?
Thanks in advance..!!
First you have to convert the strings "10:00", "2:00" to a date from the current day. This can be done e.g. with the following method (error checking omitted for brevity):
Then convert your open and closing time:
Now you have to consider that the closing time might be on the next day:
And then you can proceed as @visualication said in his answer: