Android日历月从0开始 [英] android calendar month begin at 0
本文介绍了Android日历月从0开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
为什么Java日历中的1月1月为0?
似乎android中的日历使月份从0开始。
为什么应该这样设计?
It seems that calendar in android makes month begins from 0. Why should it be designed like this?
final Calendar c = Calendar.getInstance();
mMonth = c.get(Calendar.MONTH);
今天,mMonth是4。
Today, the mMonth is 4.
推荐答案
Android开发人员未完成此操作。这就是 java.util.Calendar
中的工作方式。
如果您想知道Java开发人员为何以这种方式设计它,请遍历此线程。
为什么Java日历中的1月为0? >
This was not done by the Android developers. This is how it works in java.util.Calendar
.
If you want to know why the Java developers designed it this way, please go through this thread.
Why is January month 0 in Java Calendar?
这篇关于Android日历月从0开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文