Java tutorial
import java.time.Duration; import java.time.LocalDateTime; import java.time.Month; import java.time.ZoneId; import java.time.ZonedDateTime; public class Main { public static void main(String[] args) { LocalDateTime l = LocalDateTime.of(2012, Month.AUGUST, 13, 0, 0, 0); ZonedDateTime z = ZonedDateTime.of(LocalDateTime.of(2014, Month.AUGUST, 13, 0, 0, 0), ZoneId.of("America/Los_Angeles")); Duration duration = Duration.between(l, z); System.out.println(duration); } }