Android 2.3 was recently released last night. So naturally I tried my app on it and found there was date formatting issue. I have noticed the DateFormatter produces different formats. So do this in a simple Java program:
((SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.LONG,
DateFormat.LONG)).format(new Date());
Output is
December 7, 2010 11:49:40 AM EST
Do the same thing in an android emulator and you get
December 7, 2010 11:42:50 AM GMT-05:00
Notice the different time zone. Has anybody ran in to this issue? Is there another formatter I can use that doesn't depend on Java's implementation?
EDIT: Ok so here is more detail to why I think this is broken:
Using this code:
private final DateFormat format =
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");
I tried to parse a date but the following error is thrown:
12-07 12:55:49.556: ERROR/DateDeserializer(847): Error when parsing date
java.text.ParseException: Unparseable date: "Mon, 06 Dec 2010 17:13:35 EST"
at java.text.DateFormat.parse(DateFormat.java:626)
at com.currency.mobile.client.DateDeserializer
.deserialize(DateDeserializer.java:31)
at com.currency.mobile.client.DateDeserializer
.deserialize(DateDeserializer.java:19)
at org.codehaus.jackson.map.deser.SettableBeanProperty
.deserialize(SettableBeanProperty.java:149)