mardi 2 novembre 2021

subtracting time from current time js

I have 2 strings, that have the minute and hour that a function needs to occur at.

so i want to check, if the minute and hour which are specified in string format, and from my database are within 5 minutes of the current time, call this function.

So my original thought was something like:

(today.minute is the current minute)
if (today.minute - 5 == minute) {
   myFunc()
}

but that isn't going to work. how can i do this?

Aucun commentaire:

Enregistrer un commentaire