Parsing date with SimpleDateFormat

by » Sat, 28 Mar 2009 01:39:54 GMT

Sponsored Links
 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");
    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.

Parsing date with SimpleDateFormat

by Mike Collins » Tue, 31 Mar 2009 05:37:44 GMT

 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-
Date d = dateFormater.parse(s);

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


On Mar 27, 10:39am, ""


Sponsored Links

Other Threads

1. Event triggers when I click around marker


I displayed map and on top of map, I displayed a number of overlay
Items(Markers). Clicking on overlay Items or markers will do some
action. But the problem is when I click around the marker, means
outside the marker, at that time also, the event triggers. I want to
restrict that exactly when I am clicking on the marker, event has to
take place. I am doing the event in opTap() method.

How can I restrict the event triggering to exactly when I click on the



2. Network Problems when using AVP with Google API

I am working on a Windows XP Machine. When running AVDs out of
Eclipse, I am getting "No Network Connection" when I am plugged into
my company's network and using an AVD that was built with the "Google
APIs by Google Inc., Android API 7, revision 1".

If I use this same AVD (Google API) and connect to the internet
through a Verizon Wireless card, the AVD gets an Internet Connection.

If I use an AVD built with "SDK Platform Android 2.1, API 7, revision
1", and connect through my company's network, the AVD gets an Internet

Any ideas what might be blocking the internet connection on "Google
API by Google  Inc., Android API 7, revsion 1" when I am on the
company network? I am guessing it is something in my company's
network, but why only with the AVD created with the Google API?


3. Booting android from sd card

4. Reboot ...

5. OOT Facebook for Android

6. Getting one form data on anather forn

7. VillainROM 5.3 Release Versio