Created
March 15, 2017 15:36
-
-
Save kirilloid/794246a38e5f347af7514dea0a7b9064 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.util.Locale; | |
import java.util.Date; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
public class HelloWorld | |
{ | |
public static void main(String[] args) | |
{ | |
Locale hiDflt = Locale.forLanguageTag("hi-IN"); | |
Locale hiDeva = Locale.forLanguageTag("hi-IN-u-nu-deva"); | |
Locale hiLatn = Locale.forLanguageTag("hi-IN-u-nu-latn"); | |
DateFormat df_hiDflt = SimpleDateFormat.getTimeInstance(DateFormat.SHORT, hiDflt); | |
DateFormat df_hiDeva = SimpleDateFormat.getTimeInstance(DateFormat.SHORT, hiDeva); | |
DateFormat df_hiLatn = SimpleDateFormat.getTimeInstance(DateFormat.SHORT, hiLatn); | |
System.out.println("date (" + hiDflt.getUnicodeLocaleType("nu") + "): " + df_hiDflt.format(new Date())); | |
System.out.println("date (" + hiDeva.getUnicodeLocaleType("nu") + "): " + df_hiDeva.format(new Date())); | |
System.out.println("date (" + hiLatn.getUnicodeLocaleType("nu") + "): " + df_hiLatn.format(new Date())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment