9951 explained code solutions for 126 technologies


nodejsHow to add seconds to date/time COPY


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

create date/time management object

.setTime(

sets unix timestamp in milliseconds

.getTime()

returns unix timestamp in milliseconds

+ 10

number of seconds to add to our time

1000

convert second to milliseconds