get Unix Timestamp from Instant - Java java.time

Java examples for java.time:Instant

Description

get Unix Timestamp from Instant

Demo Code


//package com.java2s;

import java.time.Instant;

public class Main {
    public static long getUnixTimestamp() {
        return Instant.now().getEpochSecond();
    }/*from   w  w w .ja  va 2 s  . c om*/
}

Related Tutorials