setMinutes()We can set the minutes part of the date object by using setMinutes function. By using this we can set the minute from 0 to 59. Let us try to set the minutes to 20 of a date object. Here is the example
Here is the output based on your time zone and date and time of your computer
Setting minutes to a negative valueWhat happens if we set the minutes value to -75? Here is the sample code , just change the line in above code to
The output of this change is here.