Log in

View Full Version : How to go around the server to display correct time on forum


DocBenny
11-10-2005, 02:37 AM
My horrible host is not helping, or is not admitting that there is a problem. But the server time apparently is totally screwed. Even the minutes are wrong, and no matter how much I play with the GMT settings, it's all messy.

The guys at vbulletin.com told me that there might be a hack code to go around this problem, so that my forum doesn't read the time directly from the server. And told me that someone here can perhaps help me.

I would tremendeously appreciate any help about this. It's been a month with this problem and I'm going nuts. Please help.

If someone can help, bear in mind that I'm pretty new to this, and my expertise does not lie in computers. :)

DocBenny
11-11-2005, 06:01 AM
Can someone just tell me if such a code exists or can be done, at least? :(

Let me know if I've posted this in the wrong forum. Sorry.

Marco van Herwaarden
11-11-2005, 10:15 AM
I don't know of any hack that could help you with this. The only thing i can think of, is to edit the following code in your ./includes/init.php, and adjust the time. But not sure if that would be enough to change everywhere.
// start the page generation timer
$pagestarttime = microtime();
define('TIMESTART', microtime());

// set the current unix timestamp
define('TIMENOW', time());


By best advice would be to change hosts.

phonexpo
11-11-2005, 12:29 PM
My horrible host is not helping, or is not admitting that there is a problem. But the server time apparently is totally screwed. Even the minutes are wrong, and no matter how much I play with the GMT settings, it's all messy.

The guys at vbulletin.com told me that there might be a hack code to go around this problem, so that my forum doesn't read the time directly from the server. And told me that someone here can perhaps help me.

I would tremendeously appreciate any help about this. It's been a month with this problem and I'm going nuts. Please help.

If someone can help, bear in mind that I'm pretty new to this, and my expertise does not lie in computers. :)

I'm having the same problem mate, I'm moving hosts the weekend. I'd take MarcoH64 advice and move. Who are your hosts anyway?

DocBenny
11-11-2005, 08:48 PM
Thanx for the helpt, I'll try modifying that and see what happens.

I would change my host in a second, but I have paid for the whole year(can't get a refund), and just for that I don't want to move yet.

I trusted my co-admin and got a host from abroad, an eastern euro country, although the servers are located in Chicago. But man, am I sorry. Totally unprofessional.

I don't know of any hack that could help you with this. The only thing i can think of, is to edit the following code in your ./includes/init.php, and adjust the time. But not sure if that would be enough to change everywhere.
// start the page generation timer
$pagestarttime = microtime();
define('TIMESTART', microtime());

// set the current unix timestamp
define('TIMENOW', time());


By best advice would be to change hosts.

Where would I adjust the time in that code. I found the code, but it appears just as you typed it, would I enter some numerical values anywhere?

Sorry, I am not knowledgable about this.

Marco van Herwaarden
11-12-2005, 05:07 AM
Something like (i used plus in the following example, but it could also be minus):
define('TIMESTART', microtime() + 9999);

// set the current unix timestamp
define('TIMENOW', time() + 99);

99 = seconds
9999 = milliseconds

DocBenny
11-17-2005, 03:39 AM
Thank you so much. So far it seems to be working fine with the adjustments that you gave me.

I hope it stays that way.

Thanks again

Piccante
03-16-2008, 12:22 AM
Thanks Marco. That fix has sorted out my time discrepancy too.

steven s
04-15-2008, 10:42 PM
I was looking for something like this too.
It would be cool if a script logged into an official time website and made the adjustments on a regular basis.

Lynne
04-15-2008, 11:38 PM
I was looking for something like this too.
It would be cool if a script logged into an official time website and made the adjustments on a regular basis.
You can set up a cron job on your server to do this.

Command: /etc/webmin/time/sync.pl
Set the time for once a day (or whatever)

steven s
04-16-2008, 12:08 AM
You can set up a cron job on your server to do this.

Command: /etc/webmin/time/sync.pl
Set the time for once a day (or whatever)I don't control the server.
I was hoping someone had a script that would look at the server time and adjust vB accordingly.

Marco van Herwaarden
04-16-2008, 09:41 AM
Ask the server admin to setup NTP (Network Time Protocol (http://en.wikipedia.org/wiki/Network_Time_Protocol))

steven s
04-16-2008, 10:02 AM
Thanks.
I'll forward that to my host.
Joey, are you listening? :)