Java Date Time Java Java API
java.time.Instant
public boolean isBefore(Instant otherInstant)
Checks if this instant is before the specified instant.
package com.logicbig.example.instant;import java.time.Instant;public class IsBeforeExample { public static void main(String... args) { Instant i = Instant.now(); System.out.println(i); Instant i2 = Instant.parse("2016-12-03T10:15:30.00Z"); System.out.println(i2); boolean b = i.isBefore(i2); System.out.println(b); }}
2017-05-01T20:57:49.381Z2016-12-03T10:15:30Zfalse