I am trying to parse a String to a Date and it giving me right date where as time is wrong.
SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH
Try this code you missed some lines of code
SimpleDateFormat mFormatter = new SimpleDateFormat("yyyy-MM-dd hh:mm aa", Locale.getDefault()); mFormatter.setTimeZone(TimeZone.getTimeZone("India")); Date startDate = mFormatter.parse("2015-08-20 05:00 AM");
This code working fine for me.