Here you can find the source of removeTime(Date date)
public static Date removeTime(Date date)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { final static SimpleDateFormat removeTimeDateFormat = new SimpleDateFormat("yyyy-MM-dd"); public static Date removeTime(Date date) { try {/*from w w w . ja va2 s . c om*/ return removeTimeDateFormat.parse(removeTimeDateFormat.format(date)); } catch (ParseException e) { e.printStackTrace(); throw new RuntimeException(e); } } }