9951 explained code solutions for 126 technologies


nodejsHow to add hours to date/time


let dt = new Date();
dt.setTime(dt.getTime() + 5 * 60*60*1000);ctrl + c
new Date

create date/time management object

.setTime(

sets unix timestamp in milliseconds

.getTime()

returns unix timestamp in milliseconds

5

number of hours to add to our time

60*60*1000

convert hour to milliseconds