my dates come in looking like this  "2004-08-04T19:09:02.768Z"

and I parse them like this

SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-
dd'T'HH:mm:ss'.000Z'");
dateFormater.setTimeZone(TimeZone.getTimeZone("GMT"));
Date d = dateFormater.parse(s);

Try creating a Date object and making a string out of it via the date
format,
if what you get is what you expect for input you should be ok, if not
something
has to be adjusted.

  mike


On Mar 27, 10:39 am, "[email protected]"
<[email protected]> wrote:
> Hi all,
>
> I'm trying to parse the following date string "Fri, 12 Jan 2007
> 10:00:00 +0100" using SimpleDateFormat. Here is my code :
>
> Date date;
> String pubDate = "Fri, 12 Jan 2007 10:00:00 +0100";
> SimpleDateFormat format = new SimpleDateFormat("EEE, dd MM yyyy
> HH:mm:ss zzz");
> try
> {
>     date = format.parse(pubDate);}
>
> catch(ParseException e) { }
>
> This code raises the ParseException instead of returning the
> corresponding date object.
>
> I tried a huge amount of other date formats to create the
> SimpleDateFormat but none has worked.
>
> Any guess? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to