I am a little confused about what I see with the following test code:
public class TheDateIssue {
public static void main(String[] args) {
String TIME_FORMAT = "hh:mm aa";
try {
Date theDate = new SimpleDateFormat(TIME_FORMAT).parse("13:15 pm");
System.out.println("theDate: " + theDate);
} catch (ParseException e) {
System.out.println("Exception while converting string to Date. \n" + e.getLocalizedMessage());
}
}
The time to be parsed is "13:15 pm" - but the sysout output lists the time (highlighted below). I was expecting either 13:15:00 PST or 01:15:00 pm PST
theDate: Fri Jan 02 **01:15:00 PST** 1970
What am I doing wrong? :(