title: time conversion in java for 12:00 noon
body: <pre><code>import java.text.DateFormat;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  public class ConvertDatesBetweenFormatsWithSimpleDateFormat {
  public static void main(String[] args) {
      try {
       String dateStr = "12:30";
  
          DateFormat srcDf = new SimpleDateFormat("hh:mm");
          Date date = srcDf.parse(dateStr);
          DateFormat destDf = new SimpleDateFormat("HH:mm:ss");
           dateStr = destDf.format(date);
          System.out.println("Converted date is : " + dateStr);
      }
      catch (ParseException e) {
          e.printStackTrace();
      }
  }
  } 
  </code></pre>
  
  <p>I am trying to convert date format from hh:mm to HH:mm:ss. While this code is working fine for all the time, its not givig the required result for time between 12-1. Eg:  for 12:30 its giving 00:30(it should be 12:30 instead), while for 1:30 it is giving as 13:30.
  What changes should be done in this case?</p>