Here you can find the source of todayStart()
public static long todayStart()
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.concurrent.TimeUnit; public class Main { public static final long SECOND = TimeUnit.SECONDS.toMillis(1); public static final long MINUTE = TimeUnit.MINUTES.toMillis(1); public static long todayStart() { final Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTimeInMillis(); }/*from w ww .jav a 2 s .co m*/ }