Forum Moderators: coopster
My server is in the USA and I am in UK (7 hour difference) and I am not really sure how to fix this with PHP.
I am using this script but need the time ammendment incorporated:
<?php
$date = date("Ymd");
$NumEvents=0;
$handle=opendir('../event_dates');
while (($file = readdir($handle))!==false) {
if ($file >= $date) {
include("../event_dates/$file");
$NumEvents=$NumEvents + 1;
}
}
closedir($handle);
if($NumEvents > 0)
{
echo "$NumEvents events are scheduled";
}
else
{
echo "<strong class='red'>Sorry, no events are planned at present</strong>";
}
?>
and wondered if anyone could help me with changing the time to UK.
Thank you
Justin
My server is in the USA and I am in UK
Do you, by chance, live near a town named Greenwich? I would check to see if gmdate() is returning the correct time. If your hosts server is set up correctly, then you should be able to get all of your date information in GMT, then offset the information for your time zone.