0

I have the following string: Feb 16, 2014 2:11:41 PM

I have Googled around for some time now and only see examples on converting strings in the format mmddyyyy. I can't seem to find out how to convert the format above.

How can I convert this to a Date. Thanks, Gary

Enrichman
  • 11,157
  • 11
  • 67
  • 101
Dean Blakely
  • 3,535
  • 11
  • 51
  • 83
  • by just [google search](https://www.google.com/#q=convert+date+string+to+Date) I found a bunch of exact reference for this – Baby Feb 22 '14 at 01:05

1 Answers1

3

Use below formatter:

SimpleDateFormat formatter = new SimpleDateFormat("EEE dd,yyyy HH:mm:ss aa");

Also this link would be very helpful

Devrim
  • 15,345
  • 4
  • 66
  • 74
  • actually is should be "MMM d, yyyy HH:mm:ss a" which parses without an exception but it brings about a new problem: it converts the PM time to AM!! I'm posting a new thread on that. – Dean Blakely Feb 27 '14 at 00:23