I was bitten by the problem described here: Android DatePicker year problem . In a nutshell, Android’s DatePicker expects years to be specified in years (2011 is 2011), while Java’s Date class starts at 1900 (so 2011 is actually 111).
Is there a better way to intermix Date and DatePickers, other than adding and substracting 1900 when doing the conversions?
Itay.
Yes – don’t use the deprecated methods in
Dateto work with day/month/year values.Datejust represents an instant in time – you should useCalendarif you want to translate that into some appropriate human breakdown into days, months, years etc – and to apply time zones.