Java tutorial
//package com.java2s; import java.util.Date; public class Main { /** * Get the long representation of the beginning of the current date * @return current date in system time */ public static long getCurrentDateStartLong() { final Date currentDate = new Date(System.currentTimeMillis()); final Date currentDateBeginning = new Date(currentDate.getYear(), currentDate.getMonth(), currentDate.getDate()); return currentDateBeginning.getTime(); } }