Skip to content

Tag: time-format

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

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 …

OffsetTime.parse causes an exception with ISO_TIME formatter

I am trying to convert between LocalTime and strings by using the ISO_TIME formatter, but I get an exception. My Code is like: the last line throws an exception: Why is this happening and how could I solve this problem? Thanks in advance for any help, Anas Answer This is happening because, well, it’s ri…