Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.TimeZone; public class Main { public static Long getToday() { Calendar today = Calendar.getInstance(); today.setTimeZone(TimeZone.getDefault()); today.set(Calendar.SECOND, 0); today.set(Calendar.MINUTE, 0); today.set(Calendar.HOUR_OF_DAY, 1); today.set(Calendar.MILLISECOND, 0); // FOR DEBUG //today.set(Calendar.DAY_OF_YEAR, today.get(Calendar.DAY_OF_YEAR) + 1); return today.getTimeInMillis(); } }