Created
March 27, 2015 23:09
-
-
Save robsongomes/94e2fda37adb8e95477a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.*; | |
public class InstantTeste { | |
public static void main(String args[]) { | |
Instant t1 = Instant.now(); | |
System.out.println(t1); | |
Instant t2 = t1.plusSeconds(10); | |
System.out.println("T1 + 10s: " + t2); | |
Instant t3 = t2.minusSeconds(10); | |
System.out.println("T2 - 10s: " + t3); | |
System.out.println("T1 == T3: " + t1.equals(t3)); //true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment