Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Timezone Math Re: Timezone Math

#97423
karlpcrowley
Participant

Your code doesn’t know it’s a time
I don’t have access to run PHP at the moment but try this:


//3600 = 1 hour
$time = 18*3600; // 18 for 6PM


$a = $time + 36000; // +10 hours
$b = $time - 14400; // -4 Hours

echo "+10 hours: ";
print date("G:i",$a);

echo " -4 hours: ";
print date("G:i",$b);

?>