简体   繁体   中英

How to get default calendar type in Java

Is there any way to get information about default calendar type used in specified location? (Gregorian, Chinese...)

I can get Calendar object with:

DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM, new Locale("en","us"));
Calendar c = formatter.getCalendar();

However I do not see any information about calendar type.

I managed to do it in .NET so maybe there is something similar in JAVA.

Thanks

Should be for default :

Calendar.getInstance();

And for locale :

Calendar.getInstance(locale); //e.g. locale= new Locale("de", "ch");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM