开发者

Android: Gregorian Calendar issue

I am getting confuse with using Gregorian.

I am using GregorianCalendar to get the current date and setting the future date.

The current month : it prints me the mo开发者_如何学编程nth as 8 rather 9 where 9 is my expected month. The current year : it prints me the year in 2011 which is correct.

What is going wrong.

The code I use is GregorianCalender.getInstance(); to get the current date.


Using the jdk's calendar is a little confusing and you'll have to write a lot of code. Instead try a library called joda - http://joda-time.sourceforge.net/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜