Created
March 14, 2016 15:08
-
-
Save victorvaz/01f8ef88c58249fd1dc4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.text.SimpleDateFormat; | |
import java.util.Date; | |
public class FormatarSimpleDateFormat { | |
public static void main (String[] args) { | |
Date data = new Date(); | |
System.out.println(data); // Mon Mar 14 12:06:56 BRT 2016 | |
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); | |
System.out.println(sdf.format(data)); // 14/03/2016 12:06:56 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment