0

I am working on Android application in which I am trying to format my date according to my 2/1/16 5:20 AM Date.

But I am getting

java.text.ParseException: Unparseable date: "2/1/16 5:20 AM" (at offset 1).

My code is given below:

DateFormat fAfterUTC = new SimpleDateFormat("MM dd yy HH:mm aa");
Date dSelectedAfterUTC = fAfterUTC.parse("2/1/16 5:20 AM");
halfer
  • 19,824
  • 17
  • 99
  • 186
Usman Khan
  • 3,739
  • 6
  • 41
  • 89

1 Answers1

2

Your SimpleDateFormat is missing the /`s:

new SimpleDateFormat("MM/dd/yy HH:mm aa")
Cory Charlton
  • 8,868
  • 4
  • 48
  • 68