Here you can find the source of getSecondsSinceJavaEpoch(LocalDateTime localDateTime)
private static long getSecondsSinceJavaEpoch(LocalDateTime localDateTime)
//package com.java2s; // Licensed under the MIT license. See LICENSE file in the project root for full license information. import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.concurrent.TimeUnit; public class Main { private static long getSecondsSinceJavaEpoch(LocalDateTime localDateTime) { // Adjust TimeZone Offset: OffsetDateTime zdt = localDateTime.atOffset(ZoneOffset.UTC); // Get the Epoch Milliseconds: long milliseconds = zdt.toInstant().toEpochMilli(); // Turn into Seconds: return TimeUnit.MILLISECONDS.toSeconds(milliseconds); }//from www . j a v a2s . c o m }