public static void main(String[] args) throws ParseException {
long DAY = 1000 * 60 * 60 * 24;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date yDate = simpleDateFormat.parse("2020-06-12 23:58:33");
System.out.println(yDate.getTime() - (yDate.getTime() % DAY));
Date date = simpleDateFormat.parse("2020-06-13 00:29:38");
System.out.println(date.getTime() - date.getTime() % DAY);
}
the console print: 1591920000000 1591920000000