Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static long getTodayStartTime() { Calendar date = new GregorianCalendar(); date.set(Calendar.HOUR_OF_DAY, 0); date.set(Calendar.MINUTE, 0); date.set(Calendar.SECOND, 0); date.set(Calendar.MILLISECOND, 1); return date.getTimeInMillis(); } }