Web Hosting Talk







View Full Version : gmDate question


matt2kjones
12-13-2002, 05:29 PM
ok i have a question here

if your showing the time and date using gmDate

how do you alter the time, if for example, the server timezone is different to your timezone??

you could do this :

$hour = gmDate("g");

$hour = $hour + 1;

but doing that would only alter the hour.

the actual date would still change at the wrong time

is it possible?

MarkIL
12-14-2002, 09:24 AM
$offset = 2; // +2 hours
$date = intval(gmdate('U'));
$date += 3600*$offset;
print date('r',$date);