开发者

Why does Calendar.get(Calendar.MONTH) return 0? [duplicate]

This question already has answers here: Why is January month 0 in Java Calendar? (18 answers) Closed 9 years ago. 开发者_开发知识库

why does the following return 0?

int currMonth = c.get(Calendar.MONTH);


The Months are numbered from 0 (January) to 11 (December).

Reference:

  • Calendar.MONTH


Not natural indexing, but unnatural thinking of Sun people. :-)


oops! sorry - I figured it out. Natural Indexing of course!!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜