|
Author |
Message |
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Mon Dec 30, 2002 2:47 pm (21 years, 3 months ago) |
|
Hey,
I want to change the date and time to display in GMT in this script, rather than the server local time, What do I need to change, and what to in the code from the script below to do this?
Code: |
ob_start("cachepage");
$phemplate->set_file('main','templates/main.htm');
$phemplate->set_var('announcements',$announcements);
if ($config["cache"]) {
$phemplate->set_var('cacheinfo','<p class="main">Page is generated every '.$config["cache"].' minute(s). Page last generated: '.date($config["dateformat"]).'.</p>');
} else {
$phemplate->set_var('cacheinfo','');
}
$phemplate->set_var('timezone',date("T") . " (GMT " . preg_replace("/([+-])([\d]{2})([\d]{2})/","\\1\\2:\\3",date("O")) . ")");
$phemplate->set_loop('groups',$groups);
echo $phemplate->process('proc_main','main',1);
ob_end_flush();
?> |
Any Help would be appreciated. |
|
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Thu Jan 02, 2003 5:55 pm (21 years, 3 months ago) |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Thu Jan 02, 2003 6:05 pm (21 years, 3 months ago) |
|
Its hard to know what its doing out of context (for me anyway)
I see something about timezones is that some kind of config setting?
or instead of using date() what about gmdate()??
N.B. I'm stabbing in the dark cause I dont really know |
|
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Thu Jan 02, 2003 6:20 pm (21 years, 3 months ago) |
|
Darren wrote: | Its hard to know what its doing out of context (for me anyway)
I see something about timezones is that some kind of config setting?
or instead of using date() what about gmdate()??
N.B. I'm stabbing in the dark cause I dont really know |
Hiya,
was a good stab then, as thats what it was, have now fixed it, I really should have thought of that myself to be honest, but I've very rarely used gmdate, I always used to use date and then do an offset in php to get my end result.
Thanks Again! |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Thu Jan 02, 2003 7:08 pm (21 years, 3 months ago) |
|
No probs! |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.223821 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |