Date - Single Event

The following script allows you to set a future date to run a function, the example shows the current date and time plus 5 seconds.

Current date and time
Target Date

Format = Month Date Year Hours:Minites:Seconds

<script type="text/javascript">
<!--
// realised by apachejeff
// www.huntingground.freeserve.co.uk

target_date="Jan 01 2004 12:16:00" // Format = Month Date Year Hours:Minites:Seconds

function checkdate() {
today=new Date()
today=Date.parse(today)
targetdate=Date.parse(target_date)

if(today>=targetdate){
alert("The target date has expired") // your function
}
else{
timer=setTimeout("checkdate()",1000)
}

}

// add onload="checkdate()" to the opening BODY tag

// -->
</script>