@ SuppressWarnings ( "deprecation" ) private Date setHourToZero ( Date in ) { final Date d = new Date ( in . getTime ( ) ) ; d . setHours ( 0 ) ; d . setMinutes ( 0 ) ; d . setSeconds ( 0 ) ; // a trick to set milliseconds to zero long t = d . getTime ( ) / 1000 ; t = t * 1000 ; return new Date ( t ) ; }
Set hour minutes second and milliseconds to zero .