Java Calendar getTimeInMillis() MethodThe getTimeInMillis() method of java.util.Calendar class returns the current time in millisecond. This method returns a long value. SyntaxParameterNo parameter is passed. ReturnsThe current time as UTC milliseconds. ThrowsThrows InterruptedException Example 1Output: Current time : Wed Aug 08 21:54:18 PDT 2018 Current time in Millis : 1533790458542 Next time is : 1533790458620 Example 2Output: Current time in Millis : 1533791120506 Current time in Millis after adding 20 hours : 1533863120506 Next time is : 1533791120539 Next TopicJava-calendar-gettime-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