how can I get the current date minus 20 seconds in javascript? I can not figure out how to subtract 20 seconds to the current date in javascript how can I do, I get a negative value in this way
There is an easier way? thanks
var currentDate = new Date()
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
var ora = currentDate.getHours()
var minuti = currentDate.getMinutes()
var secondi = currentDate.getSeconds()-20