Javatpoint Logo
Javatpoint Logo

Java SQL Date setTime() Method

The setTime() method of Java Date class sets an existing date object by using the given millisecond time value. The driver will set the time components to the time in the default time zone if the given milliseconds value contains time information. This method overrides the setTime method in class Date.

Syntax

Parameters

date - It is the milliseconds since January 1, 1970, 00:00:00 GMT not to exceed the milliseconds representation for the year 8099. A negative number indicates the number of milliseconds before January 1, 1970, 00:00:00 GMT.

Returns

NA

Example 1

Test it Now

Output:

Current time = 1212121212

Next TopicJava SQL Date





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA