<?php
$local = +7200;
$now = time();
// Function to convert time differnece between midnight and servertime
// +/- the time offset for local time (specified in xoops_version.php config.)
// $Local is the offset
// $now is time()
// returning difference in seconds
function xoops_onair_GetCorrectTime ($local, $now) {
$midnight = strtotime('midnight');
$difference = $now - $midnight+$local;
return $difference;
}
echo date("H:i:s",xoops_onair_GetCorrectTime ($local, $now));
echo "<br/>";
echo date("h:i:s a",xoops_onair_GetCorrectTime ($local, $now));
?>
One mistake and you have to support it for the rest of your life.