I'm having problem parsing the Date from an input string that is of the following format:
String input = "Fri Jul 15 12:00:00 GMT+300 2011";
String dateFormat = "EEE MMM d HH:mm:ss z yyyy";
Date date = new SimpleDateFormat(dateFormat).parse(input);
An exception is thrown:
java.text.ParseException: Unparseable date: "Fri Jul 15 12:00:00 GMT+300 2011"
at java.text.DateFormat.parse(DateFormat.java:337)
I bet it has got something to do with the GMT string. I think I've tried it with z
, zzz
, zZ
, and zzzZ
.
Any thoughts? Is the input GMT+300
even a standard, valid input format?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…