-1
Check if this is what you want:
var cont = 0;
var pontos = 0;
function contador() {
document.getElementById('tempo').innerHTML = cont;
if(cont == 60){
cont = 0;
pontos++;
document.getElementById('pontos').innerHTML = pontos;
}
cont++;
setTimeout("contador()", 1000);
}
window.onload = function () {
//Insere as datas de inicio e fim do contador.
var datainicio = '03/04/2019 00:00:00';
var datafim = '05/04/2019 00:00:00';
var hoje = new Date();
var dd = String(hoje.getDate()).padStart(2, '0');
var mm = String(hoje.getMonth() + 1).padStart(2, '0');
var yyyy = hoje.getFullYear();
var hh = String(hoje.getHours()).padStart(2, '0');
var MM = String(hoje.getMinutes()).padStart(2, '0');
var ss = String(hoje.getSeconds()).padStart(2, '0');
hoje = mm + '/' + dd + '/' + yyyy + ' ' + hh + ':' + MM + ':' + ss;
if(hoje >= datainicio && hoje <= datafim){
contador();
}
}
<b>Tempo: </b><span id="tempo">0</span></br>
<b>Pontos: </b><span id="pontos">0</span>
show... this same just could not reset if an update takes place
– Fabio Henrique
You will have to work with database for this type of recording if I helped you mark as response. Thank you!
– Gustavo Luciano
I thought of taking the current seconds date_default_timezone_set('America/Sao_paulo'); $hour = date('H:i:s'); taking the current time with current second
– Fabio Henrique
like the count starts from the current schedule and second would not be able to do so ?
– Fabio Henrique
I don’t quite understand your doubt, try to be a little clearer on what you need.
– Gustavo Luciano
Then example the count would start at 01/04/2019 at 12:00:00 until 05/04/2019 12:00:00. We know that this interval has 5760 minutes that would be the "Points" . would be to make the calculation of minutes between dates and time always showing a chronometer updating the points that would actually be minutes
– Fabio Henrique
https://www.topster.pt/calendario/zeitrechner.php?styp=zeit&sdatum=2019-04-01&szeit=12%3A00%3A00&typ=zeit&edatum=2019-04-05&ezeit=12%3A00%3A00&subDazu=%2B&jahredazu=0&wochendazu=0&tagedazu=3&zeitdazu=00%3A00%3A00
– Fabio Henrique
In case you want a minute count remaining between two dates?
– Gustavo Luciano