Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
Muffin
Client



Joined: Apr 10, 2004
Posts: 649
Location: UK

PostPosted: Sun Jun 06, 2004 2:55 pm Reply with quote

I think I've asked before but can't remember.

People can change the time in the forums, but how on earth do you get the right time to show on the rest of the site.

Statistics show up on my site in US time.

Here's my problem, my sites in the UK my servers in the US.

So common sense tells me that I can't change the server time for the rest of the site, right?
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Jun 06, 2004 4:08 pm Reply with quote

You are correct in your understanding. However, I picked this up in my travels and don't know for sure if it still works. Replace your function in mainfile.php with this one. Note the -15 ? That is the number of hours to offset. Let us know if this still works (or ever did Laughing )
Code:
function formatTimestamp($time) {

    global $datetime, $locale;
    setlocale (LC_TIME, $locale);
    ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
    $datetime = strftime(""._DATESTRING."", mktime(($datetime[4]-15),$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
    $datetime = ucfirst($datetime);
    return($datetime);
}
 
View user's profile Send private message
Muffin







PostPosted: Sun Jun 06, 2004 6:00 pm Reply with quote

woohoo thanks Raven, I'll give it a go and let you know if it works.

watch this space lol


*edited*

It didnt work I've pm'd you the parse error I received.
 
Raven







PostPosted: Sun Jun 06, 2004 7:38 pm Reply with quote

Before I even look at the PM, you need to make the overflow lines 1 long line. Try that. In other words, lines 4 and 5 should be one line and lines 6 and 7 should be one line.
 
Muffin







PostPosted: Thu Jun 10, 2004 11:26 am Reply with quote

Thanks Raven, I tried again without wordwrap on lol
and it still doesnt work.

The time here now is 18.31 and the hourly stats are showing 13.00 - 13.59

We're about 5hrs ahead of the server time, so the stats are always out. Sad

I've replaced my original mainfile now ............. sob!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©