Java Gregorian Calendar Returns Wrong Month

前端 未结 3 1151
自闭症患者
自闭症患者 2020-12-22 09:09

So I been at this for a few hours now and it returns the correct Year, and Day but for some odd reason it returns the wrong month. I\'m sure its a simple fix but I can\'t se

3条回答
  •  太阳男子
    2020-12-22 09:31

    Try using new date and time library provided by Java 8, which are inspired by Joda-Time and they are easy to use. It also solved problem of having month starting with 0.

提交回复
热议问题