Java Date Time Java Java API
java.time.OffsetDateTime
public boolean isAfter(OffsetDateTime other)
Checks if this OffSetDateTime's instant is after the provided one's.
package com.logicbig.example.offsetdatetime;import java.time.*;public class IsAfterExample { 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.isAfter(d2); System.out.println(b); }}
true