Here you can find the source of getMillis(LocalDateTime time)
public static long getMillis(LocalDateTime time)
//package com.java2s; //License from project: LGPL import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.chrono.ChronoZonedDateTime; public class Main { public static long getMillis(LocalDateTime time) { if (time == null) { return 0; }/*from w w w . j a v a2 s . c om*/ Instant instant = ((ChronoZonedDateTime) time.atZone(ZoneId.systemDefault())).toInstant(); return instant.toEpochMilli(); } }