Java Instant getEpochSecond() method

The getEpochSecond() method of Java Instant class is used to get the number of seconds from the Java epoch of 1970-01-01T00:00:00Z The epoch second count is a simple incrementing count of seconds where second 0 is 1970-01-01T00:00:00Z. The nanosecond part of the day is returned by getNano().

Syntax

Parameters

No parameters.

Return

The seconds from the epoch of 1970-01-01T00:00:00Z.

Example 1

Output:

The output will be like this.

1488537450