title: LocalTime into Json - unable to change time format
body: <p>I have a class like the following</p>
  <pre class="lang-java prettyprint-override"><code>public class TimePeroid implements Comparable&lt;TimePeroid&gt;, Serializable {
  
      private static final long serialVersionUID = -65707223409901256L;
          
      @Expose
      //@JsonFormat(pattern=&quot;HH:mm:ss&quot;)
      private LocalTime start;
          
      @Expose
      //@JsonFormat(pattern=&quot;HH:mm:ss&quot;)
      private LocalTime end;
      //getter setter
  }
  </code></pre>
  <p>At response time when I convert it into a JSON string with the help of <code>ObjectMapper</code>, I get a JSON string like below</p>
  <pre class="lang-json prettyprint-override"><code>{
  &quot;start&quot; : {&quot;hour&quot;:6,&quot;minute&quot;:0,&quot;second&quot;:0,&quot;nano&quot;:0},  
  &quot;end&quot;:{&quot;hour&quot;:18,&quot;minute&quot;:0,&quot;second&quot;:0,&quot;nano&quot;:0}  
  }
  </code></pre>
  <p>But I need it like this</p>
  <pre class="lang-json prettyprint-override"><code>{  
  &quot;start&quot;:&quot;06:00:00&quot;,  
  &quot;end&quot;:&quot;18:00:00&quot;  
  }
  </code></pre>
  <p>What I've tried until now</p>
  <p><strong>Solution 1</strong></p>
  <pre class="lang-java prettyprint-override"><code>spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS = false
  </code></pre>
  <p><strong>Solution 2</strong></p>
  <pre class="lang-java prettyprint-override"><code>@JsonFormat(pattern=&quot;HH:mm:ss&quot;)
  </code></pre>
  <p><strong>Solution 3</strong></p>
  <pre class="lang-java prettyprint-override"><code>ObjectMapper mapperObj = new ObjectMapper();
                  mapperObj.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
                  DateFormat df = new SimpleDateFormat(&quot;HH:mm&quot;);
                  mapperObj.setDateFormat(df);
  </code></pre>
  <p>None of them works. please help me on this</p>