I am trying to convert from string to date. An example is : Wednesday, September 4, 2013 at 5:07pm
I first convert it to: Wednesday, September 4, 2013 at 5:07 PM
And use the following code:
SimpleDateFormat format = new SimpleDateFormat("EEEE, MMMM d, yyyy 'at' hh:mm a");
But I always get the Unparseable date Exception.
Any help is appreciated!
The following works for me:
String str = "Wednesday, September 4, 2013 at 5:07 PM";
SimpleDateFormat format = new SimpleDateFormat("EEEE, MMMM d, yyyy 'at' hh:mm a", Locale.US);
But if I remove the Locale
, then I get a ParseException
. Your computer Locale
corresponds probably not to a english speaking locale.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With