public class InstantClass { public static void main(String[] args) { // parse() Instant inst = Instant.parse("2017-02-03T10:37:30.00Z"); System.out.println(inst); // now() Instant instant = Instant.now(); System.out.println(instant); // minus() Instant instant1 = Instant.parse("2017-02-03T11:25:30.00Z"); instant1 = instant1.minus(Duration.ofDays(125)); System.out.println(instant1); // plus() Instant inst1 = Instant.parse("2017-02-03T11:25:30.00Z"); Instant inst2 = inst1.plus(Duration.ofDays(125)); System.out.println(inst2); // isSupportd Instant inst3 = Instant.parse("2017-02-03T11:35:30.00Z"); System.out.println(inst3.isSupported(ChronoUnit.DAYS)); System.out.println(inst3.isSupported(ChronoUnit.YEARS)); } }
Thursday, 9 February 2017
Date : InstantClass
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment