Sets the time (hour, minute, second, millisecond) of the given date and returns a new Date instance.
The original date.
The hour to set (default: 0).
The minutes to set (default: 0).
The seconds to set (default: 0).
The milliseconds to set (default: 0).
A new Date with the updated time.
setTime(new Date(), 10, 30); // → today at 10:30 AM Copy
setTime(new Date(), 10, 30); // → today at 10:30 AM
Sets the time (hour, minute, second, millisecond) of the given date and returns a new Date instance.