简体   繁体   English

如何在Java中获取默认日历类型

[英]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: 我可以使用以下方法获取Calendar对象:

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. 我设法在.NET中做到这一点,所以JAVA中也许有类似的东西。

Thanks 谢谢

Should be for default : 应该是默认值

Calendar.getInstance();

And for locale : 对于语言环境

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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