<分区>
我需要知道如何从日期获取当前午夜。
例如,我得到“15.06.2012 16:40:20”,我需要“15.06.2012 00:00:00”。
public List<Game> getGamesByDate(Date day) throws SQLException {
final Date startDate = day;
//here I need to convert startDate to midnight somehow
final Date endDate = new Date(day.getTime() + (23 * HOUR) + (59 * MINUTE));
final List<Game> games = gameDAO.getGamesByDate(startDate, endDate);
return games;
}