public static int truncatedCompareTo(final Date date1,final Date date2,final int field){
  final Date truncatedDate1=truncate(date1,field);
  final Date truncatedDate2=truncate(date2,field);
  return truncatedDate1.compareTo(truncatedDate2);
}

public static int truncatedCompareTo ( final Date date1 , final Date date2 , final int field ) { final Date truncatedDate1 = truncate ( date1 , field ) ; final Date truncatedDate2 = truncate ( date2 , field ) ; return truncatedDate1 . compareTo ( truncatedDate2 ) ; }
determines how two dates compare up to no more than the specified most significant field .
