Java Date Time Java Java API
java.time.OffsetDateTime
public long toEpochSecond()
package com.logicbig.example.offsetdatetime;import java.time.OffsetDateTime;import java.time.ZoneOffset;public class ToEpochSecondExample { public static void main(String... args) { OffsetDateTime d = OffsetDateTime.of(2016, 10, 15, 18, 20, 30, 100, ZoneOffset.ofHours(-5)); long l = d.toEpochSecond(); System.out.println(l); }}
1476573630