Java tutorial
import java.time.Clock; import java.time.Instant; public class Main { public static void main(String[] args) { Instant instant = Instant.now(Clock.systemDefaultZone()); System.out.println(instant.getEpochSecond()); } }