This is a simple question. does anyone know how to set up a date picker for the joda time. i have a date picker set up which is given in the Android tutorial, the method that the tutorial give to get the current date is the calender.get instance when putting the date i get into the joda time i get a weird reading of -20 between 1 march 2012 and 12 march 2012
this is the code i am using
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
Date past = new Date(112, 3, 1); // June 20th, 2010
Date today = new Date(112, mMonth, mDay); // July 24th
int days = Days.daysBetween(new DateTime(past), new DateTime(today)).getDays();
mDateDisplay.setText(""+days);
That date represents 1st April 2012 – months are 0-based. (Jan = 0, Feb = 1, etc).
I figure that 12th March is 20 days before 1st April, i.e., -20, so that would explain it.