PDA

View Full Version : Setting Time?


Stu
09-07-2002, 11:17 AM
Hi,
How can I alter the code in ShoutBox so that it shows my local Time!
At the moment everything is all set to my local time except Shoutbox, when I make a shout the time is way off, I think it's picking up the server time.

I'm in the UK and my Server is in USA.

I think I found the code that needs altering, but dont know how.
in this function is Time() could I just use Time() and add 5 hours (dont know what the syntax would be though.

function saveShout ($username, $shout, $ip) {
global $csvfile;

$shouts = fopen($csvfile,"a");
$username = str_replace("|","",$username);
$shout = str_replace("|","",$shout);
$ip = str_replace("|","",$ip);
$username = trim($username);
$shout = censortext(trim($shout));
$ip = trim($ip);
fwrite($shouts,$username."|".$shout."|".time()."|".$ip."\n");
fclose($shouts);
}

Issvar
09-07-2002, 07:51 PM
replace:
fwrite($shouts,$username."|".$shout."|".time()."|".$ip."\n");

with:
$uktime=time() +18000;
fwrite($shouts,$username."|".$shout."|".$uktime."|".$ip."\n");

18000 is 5 hours in seconds.

Stu
09-08-2002, 12:22 AM
Thanks,
Works a treat