title: How to remove milliseconds from LocalTime in java 8
body: <p>Using the java.time framework, I want to print time in format <code>hh:mm:ss</code>, but <code>LocalTime.now()</code> gives the time in the format <code>hh:mm:ss,nnn</code>. I tried to use <code>DateTimeFormatter</code>:</p>
  
  <pre><code>DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_TIME;
  LocalTime time = LocalTime.now();
  String f = formatter.format(time);
  System.out.println(f);
  </code></pre>
  
  <p>The result:</p>
  
  <pre><code>22:53:51.894
  </code></pre>
  
  <p>How can I remove milliseconds from the time?</p>