Here you can find the source of getFirstMilliOfDay(Date date)
public static Long getFirstMilliOfDay(Date date)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Long getFirstMilliOfDay(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*from ww w . j a v a 2s . com*/ cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime().getTime(); } }