I am trying to calculate the difference between two LocalDateTime.
LocalDateTime
The output needs to be of the format y years m months d days h hours m minutes
y years m months d days h hours m minutes
I found the best way to do this is with ChronoUnit.
long minutes = ChronoUnit.MINUTES.between(fromDate, toDate); long hours = ChronoUnit.HOURS.between(fromDate, toDate);
Additional documentation is here: https://docs.oracle.com/javase/tutorial/datetime/iso/period.html