Here you can find the source of convertToShortHour(Date date)
public static Date convertToShortHour(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date convertToShortHour(Date date) { if (date == null) { return null; }/*from w w w. j a v a 2s . c om*/ Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } }