Created
March 14, 2016 17:03
-
-
Save victorvaz/6b0489c176138335a224 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.text.DateFormat; | |
import java.util.Calendar; | |
import java.util.Locale; | |
public class DatasInternacionais { | |
public static void main(String[] args) { | |
Calendar c = Calendar.getInstance(); | |
DateFormat formatBrasil = DateFormat.getDateInstance(DateFormat.FULL, new Locale("pt", "BR")); | |
System.out.println(formatBrasil.format(c.getTime())); // Segunda-feira, 14 de Março de 2016 | |
DateFormat formatEUA = DateFormat.getDateInstance(DateFormat.FULL, Locale.US); | |
System.out.println(formatEUA.format(c.getTime())); // Monday, March 14, 2016 | |
DateFormat formatItalia = DateFormat.getDateInstance(DateFormat.FULL, Locale.ITALIAN); | |
System.out.println(formatItalia.format(c.getTime())); // lunedì 14 marzo 2016 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment