I created several subclasses of SimpleDateFormat to make it easier to work with the Azure feed I'm talking to on Android. One of them is as follows:
public class ISO8601TLDateFormat extends SimpleDateFormat { private static String mISO8601T = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public ISO8601TLDateFormat() { super(mISO8601T); } public ISO8601TLDateFormat(Locale inLocale) { super(mISO8601T, inLocale); } }
As you can see, the intention is to produce or interpret dates similar to
2012-03-17T00: 00: 00,000 + 0100
what awaits waiting for Azure. However, when I load Date objects built from DatePicker like this:
mDate = new Date(mDatePicker.getYear(), mDatePicker.getMonth(), mDatePicker.getDayOfMonth());
the output of ISO8601TLDateFormat is equal
3912-03-17T00: 00: 00,000 + 0100
As you can see, the year is 1900 more than me, or someone else not from the future . I carefully examined the Date object all the way to the Azure feed system, and it reports that its date is 2012, which I expected. Why is the gap SimpleDateFormat ?
source share