Java Date Time - LocalTime isAfter(LocalTime other) example








LocalTime isAfter(LocalTime other) checks if this LocalTime is after the specified time.

Syntax

isAfter has the following syntax.

public boolean isAfter(LocalTime other)

Example

The following example shows how to use isAfter.

import java.time.LocalTime;

public class Main {
  public static void main(String[] args) {
    LocalTime l = LocalTime.now();

    System.out.println(l.isAfter(LocalTime.NOON));
  }
}

The code above generates the following result.