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 1Test it NowOutput: Current time : Wed Aug 08 21:54:18 PDT 2018 Current time in Millis : 1533790458542 Next time is : 1533790458620 Example 2Test it NowOutput: Current time in Millis : 1533791120506 Current time in Millis after adding 20 hours : 1533863120506 Next time is : 1533791120539
Next TopicJava Calendar Class
|