Java Instant ofEpochSecond() methodThe ofEpochSecond() method of Java Instant class is used to obtain an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z The nanosecond field is set to zero. SyntaxParametersepochSecond - The number of seconds from 1970-01-01T00:00:00Z ReturnAn instant, not null. ExceptionsDateTimeException - If the instant exceeds the maximum or minimum instant. Example 1Output: The output will be like this. 1970-01-01T02:46:40Z Example 2Output: The output will be like this. 123123123 Next TopicJava-instant-ofepochmilli-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India