Java Instant now() methodThe now() method of Java Instant class is used to obtain the current instant from the system clock. The Java Instant now() method consists of 2 parameters:
The Instant now() method will query the system UTC clock to obtain the current instant. The Instant now(Clock clock) method will query the specified now to obtain the current time. SyntaxParametersclock - the clock to use, not null. ReturnThe current instant, not null. The current instant using the system clock, not null. Java Instant now() method ExampleExample 1Output: The output will be like this. 1410134852 Example 2Output: The output will be like this. 2017-05-01T20:57:32.709Z Java Instant now(Clock clock) method ExampleExample 3Output: The output will be like this. 2017-03-15T09:18:34.062Z Example 4Output: The output will be like this. 2017-05-01T20:57:34.818Z Next TopicJava-instant-minusseconds-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