2
I’m trying to make a script that triggers a certain function after a date and time has passed. I have tried every way but can not, always give some error or bug. My last test I did so:
var time = '08/03/2014 23:45';
setInterval(function() {
if ( Date(time) <= Date() ) {
document.body.innerHTML += 'Ring ring! ♪♫ <br>';
}
}, 1000);
No problem if the function is triggered whenever the time has passed and the value of team should be the same as the example.
This date format is
mm/dd/yy
ordd/mm/yy
? As far as I know, the builder ofDate
receives the parameter in the first format.– mgibsonbr
That’s what I was missing, but I’ve got it here
– Iago Bruno