Java examples for java.util:Hour
get Last Hour Day
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static void main(String[] argv) throws Exception { Date date = new Date(); System.out.println(getLastHourDay(date)); }//from ww w .j a v a2 s . c o m public static Calendar getLastHourDay(Date date) { Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); calendar.set(Calendar.MILLISECOND, 00); return calendar; } }