How to check if two LocalTimes are in the same day?

Viewed 171

From my UI I'm passing two LocalTime values; from time and to time. Both times are

LocalTime HH:mm

formatted. Now I need to check whether these times are in the same day. For an example if someone passes fromTime - 18:00 and toTime - 10:00, I need throw an exception. I need to check whether both times are in same day.

I tried with DateUtils.isSameDay() but it accepts dates. In my case I have only time.

Appreciate your help.

Thanks

1 Answers
Related