title: Get Hour and Minute from timestamp in Java
body: <p>I try to extract the hours + minute from the timestamp below. I tried this:</p>
  
  <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
  Date date = sdf.parse("2016-03-23 18:08:59");
  
  SimpleDateFormat sdf2 = new SimpleDateFormat("hh:mm");
  sdf2.setTimeZone(TimeZone.getTimeZone("UTC"));
  String dateStr = sdf2.format(date);
  </code></pre>
  
  <p>But I get an "unhandled exception: Java.text.parseException" in this line:</p>
  
  <blockquote>
    <p>Date date = sdf.parse(myTimeStampString);</p>
  </blockquote>
  
  <p>Can anyone help me out here?</p>