Created
October 30, 2018 02:12
-
-
Save cassiusvm/d7d596a0d961daa23a4b52bb4fa521cc to your computer and use it in GitHub Desktop.
Locale info
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.ZonedDateTime; | |
import java.util.Locale; | |
public class JVMLocaleInfo { | |
public static void main(String[] args) { | |
Locale localeDef = Locale.getDefault(); | |
System.out.println("Default Locale: " + localeDef); | |
System.out.println("Country: " + localeDef.getDisplayCountry() + ", " + localeDef.getCountry() + ", " | |
+ localeDef.getISO3Country()); | |
System.out.println("Language: " + localeDef.getDisplayLanguage() + ", " + localeDef.getLanguage() + ", " | |
+ localeDef.getISO3Language()); | |
System.out.println("Locale name: " + localeDef.getDisplayName()); | |
System.out.println("IETF BCP 47 language tag: " + localeDef.toLanguageTag()); | |
ZonedDateTime now = ZonedDateTime.now(); | |
System.out.println("Time-zone: " + now.getZone()); | |
System.out.println("Time-zone offset: " + now.getOffset()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment