4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 PHP: Script Problem
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Mon Dec 30, 2002 2:47 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Thu Jan 02, 2003 5:55 pm (21 years, 3 months ago) Reply with QuoteBack to Top

I take it nobody knows?
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Thu Jan 02, 2003 6:05 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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 Laughing
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Thu Jan 02, 2003 6:20 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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 Laughing


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!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Thu Jan 02, 2003 7:08 pm (21 years, 3 months ago) Reply with QuoteBack to Top

No probs! Very Happy
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.200983 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme