Java examples for java.util:Hour
get First 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(getFirstHourDay(date)); }//w w w .ja va 2s .c o m public static Calendar getFirstHourDay(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; } }