Javatpoint Logo
Javatpoint Logo

Java Date setTime() Method

The setTime() method of Java Date class sets a date object. It sets date object to represent time milliseconds after January 1, 1970 00:00:00 GMT.

Syntax:

Parameters

time: the number of milliseconds

Example 1

Test it Now

Output:

time after settings : Thu Jan 01 05:30:01 IST 1970

Next Topicjava.util.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