Created
March 14, 2016 14:09
-
-
Save victorvaz/a484f1f4d24b0a6881fa 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
package datanojava; | |
import java.util.Date; | |
public class ClasseDate { | |
public static void main(String[] args) { | |
// Não iremos passar uma data no construtor e então irá mostrar a data atual. | |
Date dataAtual = new Date(); | |
System.out.println(dataAtual); // Mon Mar 14 11:06:40 BRT 2016 | |
// Iremos passar uma data em Unix timestamp e então mostrar a data referente. | |
Date dataUnix = new Date(1427964000773L); | |
System.out.println(dataUnix); // Thu Apr 02 05:40:00 BRT 2015 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment