Java Instant minusMillis() methodThe minusMillis () method of Java Instant class is used to return a copy of this instant with the specified duration in milliseconds subtracted. This instance is immutable and unaffected by this method call. SyntaxParametersmillisToSubtract - The milliseconds to subtract, positive or negative. ReturnAn Instant based on this instant with the specified milliseconds subtracted, not null. ExceptionsDateTimeException - If the subtraction cannot be made. ArithmeticException - If numeric overflow occurs. Example 1Output: The output will be like this. 2017-02-03T10:37:20Z Example 2Output: The output will be like this. 2017-05-01T20:57:40.934Z 2017-05-01T20:57:40.434Z Next TopicJava-instant-minus-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