 IllIlIlllIllEliteDataPremium join:2003-07-06 Lindenhurst, NY kudos:7 | Javascript reload at specific time hi. im wondering if anyone could post the code snippet for the following: i need to have script added to my index page to reload the page at the top and bottom of every hour (every half hour) but using the current PC time. example: at the top of every hour (9:00pm, 10:00pm, 11:00pm, etc) and bottom of every hour (9:30pm, 10:30pm, 11:30pm, etc) a simple timer script would work but the timer has to start with the current PC time so that the page is reloaded at the correct time (every 30 minutes on the top and bottom of every hour) otherwise the page would reload before/after the top & bottom of every hour. if i used a simple timer script, the page would have to be loaded at the top or bottom of every hour to operate correctly. thanks ! -- Suffolk County NY Police Feed - »www.scpdny.com PS3 Gaming Feed - »www.livestream.com/elitedata |
|
 | Use the Date object and getMinutes() method.
var d = new Date(); var m = d.getMinutes();
m is going to contain a value between 0 and 59.
Do a little arithmetic and set your timer accordingly. -- Scott Brown Consulting |
|
 IllIlIlllIllEliteDataPremium join:2003-07-06 Lindenhurst, NY kudos:7 | said by sbconslt:Use the Date object and getMinutes() method.
var d = new Date(); var m = d.getMinutes();
m is going to contain a value between 0 and 59.
Do a little arithmetic and set your timer accordingly. thank you -- Suffolk County NY Police Feed - »www.scpdny.com PS3 Gaming Feed - »www.livestream.com/elitedata |
|