PDA

View Full Version : Forum time offset (for servers with time that is a few minutes off etc.)


Gary King
02-07-2004, 10:00 PM
I created this for myself, but I figured others might benefit from this as well :)

What this hack does, is makes the forum time the 'right' time by offset-ting the time a few minutes ahead or a few minutes behind than the original server time. For instance, my server is about 6 minutes behind, so I would use 360 to define the number of seconds of offset.

All you have to do, is open up includes/init.php and find:define('TIMENOW', time());


Replace with define('TIMENOW', time() + 360);
and change 360 to the number of seconds you want to be faster on the forums, or change the + to - to slow down the time on the forums :)

MGM
02-08-2004, 07:43 PM
very nice! mine is 23 minutes off ;)

* MGM clicks Install

MGM out

buro9
02-09-2004, 12:39 PM
very nice! mine is 23 minutes off ;)

* MetalGearMaster clicks Install

MGM out
Can you not get your hosts to correct this?

I'm with ventures online, and every VPS account I've had has been out... I just ask them to create a cron to run weekly and update the time against an Internet time server... and they've always done it straight away.

Afterall... the time on the system is part of their remit and not yours.

Not trying to diss the hack... may be very useful for some... but if the root cause is with your host... then get them to fix it. Can't help but think that if their servers are out, they'll continue to slip further out and you'll have to change your hack value all the time.

FleaBag
02-09-2004, 02:00 PM
This will come in handy.

buro9 - the host might not want to change the time, or simply, not have the time.

gmarik
02-09-2004, 03:58 PM
Simple, but works!

Gary King
02-09-2004, 06:36 PM
This will come in handy.

buro9 - the host might not want to change the time, or simply, not have the time.
Yeah that's what happens sometimes. For instance, you can't say that all hosts have good support etc. but some people still go with them because of reasonable prices, etc. I sometimes do that even when I don't need too much support, like on the server that I use this hack on :)

It works, it's simple, so what's the problem? ;)

Oblivion Knight
02-19-2004, 08:58 AM
It works, it's simple, so what's the problem? ;)There is none.! :D

Also, some of us don't want to bother the server admin too often.. Especially for such small things as changing the time by a few minutes. This mod does the job perfectly.

Boofo
02-19-2004, 10:00 AM
Yeah that's what happens sometimes. For instance, you can't say that all hosts have good support etc. but some people still go with them because of reasonable prices, etc. I sometimes do that even when I don't need too much support, like on the server that I use this hack on :)

It works, it's simple, so what's the problem? ;)
The problem is that if your server is off of the time now, it is going to continually be off time and you will always end up having to readjust the hack to keep the server on time. If your host is too busy to set the server time, then they aren't much of a host and not worth paying for.

Gary King
02-19-2004, 11:13 AM
The problem is that if your server is off of the time now, it is going to continually be off time and you will always end up having to readjust the hack to keep the server on time. If your host is too busy to set the server time, then they aren't much of a host and not worth paying for.
You don't have to re-adjust the time if the clock is going to the same speed as the actual world clock, but just off a few minutes; doesn't mean it is going at a different speed from the real world clock.

For instance my in case, the host just set the time wrong; but then just one installation of this hack and I don't have to worry about it ever again :)

Anyways why does it matter about this I don't know why I'm even explaining this hack this much ;) If you don't want to install it, no one is forcing you to :)

Andreas
02-19-2004, 12:08 PM
What about creating a vB-Cronjob that compares local time to a time server and stores the adjust-value in the settings-table?
This way you would not have to adjust the value manually - no PC clock never-ever goes 100% correct.

Anyway, this is a hosts issue and it should be their responsibility to keep the time correct, as this is a vital server function.

Boofo
02-19-2004, 03:40 PM
Anyways why does it matter about this I don't know why I'm even explaining this hack this much ;) If you don't want to install it, no one is forcing you to :)You'll never have to worry about that. It will never happen.

Gary King
02-19-2004, 06:29 PM
I'm not just talking to you directly, I'm just talking to everyone in general.
What's with the hostility :ermm:

Oblivion Knight
04-18-2004, 12:09 AM
It would appear that this doesn't work on 3.0.1 for some reason..

Any quick fixes for us Gary? :)

Gary King
04-18-2004, 03:02 PM
It would appear that this doesn't work on 3.0.1 for some reason..

Any quick fixes for us Gary? :)
That's strange; I'll need some confirmation from someone else running 3.0.1 as well.

Oblivion Knight
05-13-2004, 10:19 AM
Apologies, it does work - it's just my server clock being wacky..

Looks like I'll have to go and get a support ticket.

platnum
08-09-2004, 12:47 PM
You are my god Garry :D

For some reason the server time was good.. then they did an upgrade, and it went 5 mins off :|

This fixed it right up :D Very nice!

Thanks :D

Gary King
09-01-2004, 11:37 PM
No problem :)

davewolf
09-27-2006, 10:36 AM
works on 3.60 thanks real handy !