Date 在GWT中使用Listbox更改预订时间(时间戳)

Date 在GWT中使用Listbox更改预订时间(时间戳),date,gwt,listbox,Date,Gwt,Listbox,我想实现一个功能(使用GWT)来更改预订的开始和结束日期/时间 预订的开始和结束日期保存为时间戳 保留保存在mySQL数据库中 用户可以在日期选择器中选择日期: final DatePicker chooseDay = new DatePicker(); 2个列表框: final ListBox startTime = new ListBox(); final ListBox endTime = new ListBox(); 我现在的问题是,我不知道如何在格式之间进行更改。预订被保

我想实现一个功能(使用GWT)来更改预订的开始和结束日期/时间

预订的开始和结束日期保存为时间戳

保留保存在mySQL数据库中

用户可以在日期选择器中选择日期:

final DatePicker chooseDay = new DatePicker();

2个列表框:

final ListBox startTime = new ListBox();
final ListBox endTime = new ListBox();

我现在的问题是,我不知道如何在格式之间进行更改。预订被保存为时间戳,但我如何才能只更改日期和小时/分钟

我是一个初学者,如果你能帮助我,那将是非常好的。谢谢:)

使用可以在客户端使用:

JsDate jsDate = JsDate.create(startDate.getTime());
int hour = jsDate.getHours();
int mins = jsDate.getMinutes();
final ListBox startTime = new ListBox();
final ListBox endTime = new ListBox();
startTime.addItem("08:00");
startTime.addItem("08:30");
startTime.addItem("09:00"); (til 18:00)
endTime.addItem("08:00");
endTime.addItem("08:30");
endTime.addItem("09:00"); (til 18:00)
JsDate jsDate = JsDate.create(startDate.getTime());
int hour = jsDate.getHours();
int mins = jsDate.getMinutes();