Java examples for java.util:Calendar Calculation
normalize Calendar to clear time field
//package com.java2s; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { Calendar calc = Calendar.getInstance(); normalizeCalendar(calc);/*from ww w .j a va2 s . c o m*/ } public static void normalizeCalendar(Calendar calc) { calc.set(Calendar.HOUR_OF_DAY, 0); calc.set(Calendar.MINUTE, 0); calc.set(Calendar.SECOND, 0); calc.set(Calendar.MILLISECOND, 0); } }