jeudi 2 avril 2020

How to save a variable every hour?

I have a variable that I want to save every hour in a new variable, how can I do that?

What I tried is this, but it only works when the condition is true. I don´t know hot to save the value untill the condition is true again

 Time(x){
let date = new Date();
let minutes = date.getMinutes();
var y;
if(minutes == 30)
{
  y=x;
  return y;
}

}

I really need help with this, thank you for your idead.

Aucun commentaire:

Enregistrer un commentaire