Java Date Time - OffsetTime isAfter(OffsetTime other) example








OffsetTime isAfter(OffsetTime other) checks if the instant of this OffsetTime is after that of the specified time applying both times to a common date.

Syntax

isAfter has the following syntax.

public boolean isAfter(OffsetTime other)

Example

The following example shows how to use isAfter.

import java.time.OffsetTime;
/*  w  ww  .  j  av a  2s .  c om*/
public class Main {
  public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();

    System.out.println(m.isAfter(OffsetTime.now()));

  }
}

The code above generates the following result.