OffsetDateTime isBefore(OffsetDateTime other) example
Description
OffsetDateTime isBefore(OffsetDateTime other)
checks if the instant of this date-time is before that of the specified date-time.
Syntax
isBefore
has the following syntax.
public boolean isBefore(OffsetDateTime other)
Example
The following example shows how to use isBefore
.
import java.time.OffsetDateTime;
// w w w.j a v a2 s . co m
public class Main {
public static void main(String[] args) {
OffsetDateTime o = OffsetDateTime.MAX;
System.out.println(o.isBefore(OffsetDateTime.MIN));
}
}
The code above generates the following result.