Friday, March 30, 2012

[android-developers] date format problem

i try to format a date from XML file the date is in the format  "Thu, 15 Mar 2012 00:00:00 +0200"

i use that code but get an error

SimpleDateFormat formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z"); 
Date date = formatter.parse("Thu, 15 Mar 2012 00:00:00 +0200");
SimpleDateFormat simpleDateFormat =new SimpleDateFormat("dd/MM/yyyy");
String dateAsString = simpleDateFormat.format(date); 

java.text.ParseException: Unparseable date: "Thu, 15 Mar 2012 00:00:00 +0200" 

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate