0

I tried to use simpleDateFormat to convert the original format of Date string back to Date.

SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
Date a = format.parse(nowTest);

nowTest is a string Fri Mar 18 15:02:38 EDT 2016

But console told me that

java.text.ParseException: Unparseable date: "Fri Mar 18 15:02:38 EDT 2016"
    at java.text.DateFormat.parse(DateFormat.java:366)

I can't figure out why this format doesn't work. Thank you in advance

Madhawa Priyashantha
  • 9,633
  • 7
  • 33
  • 60
codemonkey
  • 331
  • 1
  • 4
  • 16
  • 3
    http://stackoverflow.com/questions/19861642/date-format-parse-exception-eee-mmm-dd-hhmmss-z-yyyy – Madhawa Priyashantha Mar 19 '16 at 02:24
  • Thank you so much. I also have a question about the format of day. Since I use dd to present, but I don't know whether the default format of Date is dd. Like 9th is default 9 or 09. ? OH I figure it out. Thank you Soooo much – codemonkey Mar 19 '16 at 02:31

0 Answers0