Here you can find the source of setTimeZero(Date dt)
Parameter | Description |
---|---|
dt | a parameter |
public static Date setTimeZero(Date dt)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**// ww w . j av a 2 s.c om * Set the time to zero 00:00:00 * @param dt * @return */ public static Date setTimeZero(Date dt) { if (dt == null) return null; GregorianCalendar gc = new GregorianCalendar(); gc.setTime(dt); gc.set(Calendar.HOUR_OF_DAY, 0); gc.set(Calendar.MINUTE, 0); gc.set(Calendar.SECOND, 0); gc.set(Calendar.MILLISECOND, 0); return gc.getTime(); } }