How can I make my system wake up every morning? I want it all dawn 4 o'clock in the morning for an alert system ("alo world") how do I do it?
How can I make my system wake up every morning? I want it all dawn 4 o'clock in the morning for an alert system ("alo world") how do I do it?
With a simple Javascript you can do this, but it is logical that the page should be running.
The endtime variable will store the end time and the checkTime () function will make sure to count the time until the logic is met.No need to refresh
var endtime = "4:00:00";
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('tempo').innerHTML=h+":"+m+":"+s;
var curtime =h+":"+m+":"+s;
t=setTimeout('startTime()',500);
if(curtime==endtime)
{
alert("alo mundo");
}
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
startTime();
<div id="tempo"></div>