Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static long getBeginOfCurrentDateInMillis() { Calendar calendar = Calendar.getInstance(); calendar.clear(Calendar.HOUR); calendar.clear(Calendar.HOUR_OF_DAY); calendar.clear(Calendar.MINUTE); calendar.clear(Calendar.SECOND); calendar.clear(Calendar.MILLISECOND); return calendar.getTimeInMillis(); } }