Como se mencionó, la fecha almacenada como 2013-01-10 00:00:00 debe convertirse a 2013-01-10 23:59:59.999 y luego tomarla como fecha de finalización.
MySql
Cuando consulta su campo de fecha y hora, puede adelantar su hora de finalización un día de la siguiente manera
DATE_ADD('your_datetime_field', INTERVAL 1 DAY)
O
Código Java
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// rs is ResultSet reference
long dt = rs.getTimestamp("your_datetime_field").getTime();
// pick calendar instance and set time
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(dt);
// this will print `2013-01-10 00:00:00`
System.out.println(sdf.format(calendar.getTime()));
// advance the date by 1 day
calendar.add(Calendar.Date, 1);
// this is print `2013-01-11 00:00:00`
System.out.println(sdf.format(calendar.getTime()));
Ahora, puedes comparar con este Calendar
objeto también.
Espero que esto ayude.