i have some problem while finding difference between times, if i try to find difference in todays time (say t1 = \"08:00:00\" and t2 = \"10:00:00\" then it is giving correct
See some options here
such as :
LocalDate today = LocalDate.now() LocalDate yeasterday = today.minusDays(1); Duration oneDay = Duration.between(today, yesterday); Duration.between(today.atTime(0, 0), yesterday.atTime(0, 0)).toDays() // another option