Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Timeout to check time

Status
Not open for further replies.

tomhughes

Vendor
Joined
Aug 8, 2001
Messages
233
Location
US
Does anyone know how to check the time, and if the time reaches a certain value trigger an event to occur? I have tried the Timeout function with the following code, but it acts like the hour value is 24, and goes to the SendEmail function, no matter what the time is.

<script language=&quot;JavaScript&quot;><!--
function everyHour() {
today = new Date();
hour = today.getHours();
setTimeout('everyHour()',3600);
document.write (hour) // check value
if (hour == 24)
{SendEmail()}
else
{DoNothing()}
}
everyHour(); // start the funtion
//--></script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top