Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static Calendar getBeginOfDate(long time) { Calendar ret = Calendar.getInstance(); ret.setTimeInMillis(time); ret.set(Calendar.HOUR_OF_DAY, 0); ret.set(Calendar.MINUTE, 0); ret.set(Calendar.SECOND, 0); ret.set(Calendar.MILLISECOND, 0); return ret; } }