Java Date Time Java Java API
java.time.LocalTime
public boolean isBefore(LocalTime other)
If this LocalTime instance is before the specified LocalTime instance, this method returns true, otherwise returns false.
package com.logicbig.example.localtime;import java.time.LocalTime;public class IsBeforeExample { public static void main (String... args) { LocalTime d = LocalTime.of(12, 30, 50); LocalTime d2 = LocalTime.of(22, 20, 10); boolean b = d.isBefore(d2); System.out.println(b); }}
true