This code synchronises the refresh to time of next update and as configured does the refresh 35 seconds after the update.
For the Saratoga tempalate I have placed it in top.php
// synchronise page refresh to tags upload time - assumes correct time zone set in php scripts to match WXsoftware timezone
// $timeofnextupdate is standard site variable in Saratoga template for both CU & WD but calculated for CU
if (isset($timeofnextupdate) && $timeofnextupdate != '---' ) {
$nextupd = (substr($timeofnextupdate,0,2)*60*60) + (substr($timeofnextupdate,3,5)*60); // next update hh:mm as seconds
$present = (date('H')*60*60) + (date('i')*60) + date('s'); // now hh:mm:ss as seconds
if ($nextupd > $present) {$metrefresh = $nextupd - $present + 35;} else {$metrefresh = 620/2;} // handle midnight
// echo "timeofnextupdate (hh:mm): " . $timeofnextupdate . " = nextupd (secs): " . $nextupd .", present (secs): ".$present . ", refresh (secs): ". $metrefresh . " - HH:" . date('H') . " MM:" . date('i') ." SS:" . date('s') . " tagtime: " . $time;
} else { $metrefresh = 620; }
// echo "default refresh: ". $metrefresh; // default
?>
<meta http-equiv="refresh" content="<?php echo $metrefresh; ?>" />