Java Date Time Java Java API
java.time.OffsetDateTime
public boolean isBefore(OffsetDateTime other)
Checks if this OffSetDateTime's instant is before the provided one's.
package com.logicbig.example.offsetdatetime;import java.time.*;public class IsBeforeExample {public static void main(String... args) { OffsetDateTime d = OffsetDateTime.of(LocalDateTime.of(2010, 10, 3, 13, 43, 30, 1000), ZoneOffset.ofHours(-5)); OffsetDateTime d2 = OffsetDateTime.of(LocalDate.of(2010, 10, 3), LocalTime.NOON, ZoneOffset.ofHours(-5)); boolean b = d.isBefore(d2); System.out.println(b);}}
false