Java Timestamp setTime() MethodThe setTime() method of Timestamp class sets this class's object to indicate a point in time(milliseconds) after January 1, 1970 00:00:00 GMT. SyntaxParametersHere the parameter 'time' represents the number of milliseconds. OverridesThe setTime() method of Timestamp class overrides: setTime() method in class Date Example 1Test it NowOutput: Timestamp : 2018-09-01 09:01:15.0 Milliseconds : 1970-01-01 06:46:07.577 Example 2Test it NowOutput: Timestamp : 2018-09-01 09:01:15.0 New Timestamp : 1969-10-10 18:45:43.211
Next TopicJava Timestamp
|