I have the following string in Java:
2011-12-21T20:27:32-08:00
Can any one tell me how do I store this string by converting it to date?
I need to store it in a MySQL column declared as TimeStamp.
I've tried the following but it does not work:
Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz").parse("2011-12-21T20:27:32-08:00");
It gives below error:
Exception in thread "main" java.text.ParseException: Unparseable date: "2011-12-21T20:27:32-08:00" –
Any help is much appreciated.