Java Instant plusSeconds() methodThe plusSeconds() method of Java Instant class is used to return a copy of the instant with the specified duration in seconds added. This instance is immutable and unaffected by this method call. SyntaxParametersecondsToAdd ? It specifies the seconds to add. It can be either positive or negative. Return
ExceptionDateTimeException - If the result exceeds the maximum or minimum instant ArithmeticException - If numeric overflow occurs Example 1Output: 2018-02-03T13:02:10Z Example 2Output: 2018-05-01T20:57:13.972Z 2018-05-02T02:30:33.972Z 2018-05-01T15:23:53.972Z Next TopicJava-instant-plusnanos-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