title: Html + Java | receiving 0 from input type="time"
body: <p>I'm trying to make an webApp, where you should pick the time you woke up. I'm using Spring, with Thymeleaf as the connecter between my java and html. But no matter what time i choose, it returns 0.  </p>
  
  <p>My StartDay Class:</p>
  
  <pre><code>/* ----------------------------
  |        StartDay Class       |
  ------------------------------ */
  
  @Entity
  @Table(name = "start_day")
  public class StartDay {
  
  @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "start_day_id")
  private int startDayId;
  @Column(name = "age_in_days", nullable = false)
  private int ageInDays;
  @Column(name = "day_created", nullable = false)
  private String dayCreated;
  @Column(name = "username", nullable = false)
  private String username;
  @Column(name = "dream_remembered", nullable = false)
  private boolean dreamRemembered;
  @Column(name = "nightmare", nullable = false)
  private boolean nightmare;
  @Column(name = "waking_time", nullable = false)
  private int wakingTime;
  @Column(name = "good_night_of_sleep", nullable = false)
  private boolean goodNightOfSleep;
  
  
  
  /* ------------------------------
  |        Getter &amp; Setter        |
  ------------------------------ */
  
  public String getDayCreated() {
      return dayCreated;
  }
  public void setDayCreated(String dayCreated) {
      this.dayCreated = dayCreated;
  }
  
  public int getAgeInDays() {
      return ageInDays;
  }
  public void setAgeInDays(int ageInDays) {
      this.ageInDays = ageInDays;
  }
  
  public boolean isDreamRemembered() {
      return dreamRemembered;
  }
  public void setDreamRemembered(boolean dreamRemembered) {
      this.dreamRemembered = dreamRemembered;
  }
  
  public boolean isNightmare() {
      return nightmare;
  }
  public void setNightmare(boolean nightmare) {
      this.nightmare = nightmare;
  }
  
  public int getWakingTime() {
      return wakingTime;
  }
  public void setWakingTime(int wakingTime) {
      this.wakingTime = wakingTime;
  }
  
  public boolean isGoodNightOfSleep() {
      return goodNightOfSleep;
  }
  public void setGoodNightOfSleep(boolean goodNightOfSleep) {
      this.goodNightOfSleep = goodNightOfSleep;
  }
  
  public String getUsername() {
      return username;
  }
  public void setUsername(String userId) {
      this.username = userId;
  }
  
  /* ------------------------------
  |          CONSTRUCTOR          |
  ------------------------------ */
  
  public StartDay(int ageInDays, String dayCreated, String username, boolean dreamRemembered, boolean nightmare, int wakingTime, boolean goodNightOfSleep) {
      this.ageInDays = ageInDays;
      this.dayCreated = dayCreated;
      this.username = username;
      this.dreamRemembered = dreamRemembered;
      this.nightmare = nightmare;
      this.wakingTime = wakingTime;
      this.goodNightOfSleep = goodNightOfSleep;
  }
  
  public StartDay() {
  }
  
  }
  </code></pre>
  
  <p>My start-dag.html page: </p>
  
  <pre><code>&lt;form th:action="@{/normal/start-dag}" th:object="${startDay}" method="post"&gt;
      &lt;div&gt;
          &lt;p&gt;Hvad tid stod du op?&lt;/p&gt;
          &lt;input type="time" name="wakingTime"&gt;
  
          &lt;p&gt;Har du sovet godt?&lt;/p&gt;
          &lt;!--&lt;input type="checkbox" name="goodNightOfSleep"&gt;&lt;span&gt;Ja&lt;/span&gt;--&gt;
  
          &lt;p&gt;Kan du huske hvad du drømte?&lt;/p&gt;
          &lt;input type="checkbox" name="dreamRemembered"&gt;&lt;span&gt;Ja&lt;/span&gt;
  
          &lt;p&gt;Var det et mareridt?&lt;/p&gt;
          &lt;input type="checkbox" name="nightmare"&gt;&lt;span&gt;Ja&lt;/span&gt;
  
          &lt;input type="hidden" name="username" /&gt;
          &lt;input type="hidden" name="ageInDays" /&gt;
          &lt;input type="hidden" name="dayCreated" /&gt;
  
          &lt;input type="submit" value="Start dag"&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Any help/suggestions is appreciated!</p>
  
  <p>UPDATE #1 – More code added </p>
  
  <p>My StartDayController</p>
  
  <pre><code>// Start\create day
      @GetMapping("/normal/start-dag")
      public  String opretGoal(Model model){
          StartDay startDay = new StartDay();
          model.addAttribute("startDay", startDay);
          return "normal/start-dag";
      }
      @PostMapping("/normal/start-dag")
      public String opretGoal(@ModelAttribute StartDay startDay, BindingResult bindingResult){
  
          startDayService.createGoalOfTheDay(startDay);
  
          return "redirect:/normal/menu";
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8C7x9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8C7x9.png" alt="Test on frontEnd"></a></p>