Here you can find the source of getDifference(LocalDateTime sourceTime, LocalDateTime targetTime)
public static long getDifference(LocalDateTime sourceTime, LocalDateTime targetTime)
//package com.java2s; //License from project: Apache License import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; public class Main { public static long getDifference(LocalDateTime sourceTime, LocalDateTime targetTime) { return targetTime.until(sourceTime, ChronoUnit.MINUTES); }// w w w . ja va 2s. co m }