This line
currentDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2014-03-06 12:59:01");
contains hh
which is the 1-12 hour format. Try using capital HH
, which uses 0-23 format.
"yyyy-MM-dd HH:mm:ss"
Output:
Thursday, March 6 at 12:59 PM
The date formatting symbols and descriptions are in the SimpleDateFormat
javadocs.