Java Instant ofEpochMilli() methodThe ofEpochMilli() method of Java Instant class is used to obtain an instance of Instant using milliseconds from the epoch of 1970-01-01T00:00:00Z The seconds and nanoseconds are extracted from the specified milliseconds. SyntaxParametersepochMilli - The number of milliseconds 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-01T00:00:10Z Example 2Output: The output will be like this. 123123123 Example 3Output: The output will be like this 2017-05-01T20:57:28.579Z Next TopicJava-instant-now-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