Java tutorial
//package com.java2s; import android.support.annotation.NonNull; import java.util.Calendar; import java.util.Date; public class Main { public static Date beginOfTheDay(@NonNull Date date) { Calendar inputDate = Calendar.getInstance(); inputDate.setTime(date); Calendar resultDate = Calendar.getInstance(); resultDate.set(inputDate.get(Calendar.YEAR), inputDate.get(Calendar.MONTH), inputDate.get(Calendar.DAY_OF_YEAR)); return resultDate.getTime(); } }