Skip to content Skip to sidebar Skip to footer

Android Datepicker Fragment Returns Date One Month Prior

OK, this is bizarre. I have a DatePicker dialog that is really simple. The problem is that no matter what date I choose, the value that comes back is exactly one month prior to the

Solution 1:

Months go from 0 to 12. From January to Undecimber.

Try comparing them against Calendar."MONTH".

Example: Calendar.OCTOBER == 9

Link: http://developer.android.com/reference/java/util/Calendar.html#MONTH.

Note: In case you use GregorianCalendar, you can ignore the thirteenth month.

Solution 2:

Please visit this link, i think month starts from 0 to 11, Please ignore if I am wrong.

Get date from datepicker using dialogfragment

Post a Comment for "Android Datepicker Fragment Returns Date One Month Prior"