Here you can find the source of timestampStartOfDay(long time)
public static long timestampStartOfDay(long time)
//package com.java2s; //License from project: Open Source License public class Main { public static long timestampStartOfDay(long time) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time);/*from w w w . j a v a 2 s . c o m*/ cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); return cal.getTimeInMillis(); } }