How to convert a string to Date in Java?

I need to convert a string pattern 01/10/2005 14:36:47-02:00 into a date object using Java. I could convert several other formats, but not this. Note the : in the timezone (-02:00). Any help is appreciated.

Public Comments

  1. simple Date date=null; try { SimpleDateFormat df=new SimpleDateFormat("MM/dd/yyyy"); date=df.parse("10/22/2005"); } catch (Exception err) { } System.out.println ("Date: "+date); // will print the Date object
Powered by Yahoo! Answers