I have timespans: String time1 = 01:00:00 String time2 = 05:00:00 I want to check if time1 and time2 both lies between 20:11:13 and 14:49:00. Actually, 01:00:00 is greater than 20:11:13 and less than 14:49:00 considering 20:11:13 is always less than 14:49:00. This is given prerequisite. So what I want is, 20:11:13 < 01:00:00 < 14:49:00. So I need something