Java examples for java.time:LocalDateTime
distance between LocalDateTime
//package com.java2s; import java.time.LocalDateTime; import java.time.ZoneOffset; public class Main { public static long distance(LocalDateTime start, LocalDateTime end) { return end.toEpochSecond(ZoneOffset.UTC) - start.toEpochSecond(ZoneOffset.UTC); }//from w w w . ja v a2 s. c o m }