当前位置: 动力学知识库 > 问答 > 编程问答 >

html - How can I store input type="time" to java object

问题描述:

From my html page I want to set a input type="time" value to my java object. But I am unsure what data type I should be expecting on my java object or, is there even a type for this?

This is my html input field:

<input style="color:black;" type="time" th:field="*{timeOut}"></input>

And the timeOut field plus getters and setters:

public static String timeOut;

public String getTimeOut() {

return timeOut;

}

public void setTimeOut(String timeOut) {

RentForm.timeOut = timeOut;

}

Having timeOut as a string works but i want to know if there is a better datatype i can cast to?

Thanks.

分享给朋友:
您可能感兴趣的文章:
随机阅读: