Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { /** * @return Return current day timestamp with YY, MM, dd info ONLY */ public static Long getCurrentDayTS() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTimeInMillis(); } }