Moved server - time wrong

 
Douzeper
Benutzer
Avatar
Geschlecht:
Herkunft: Antrim, Northern Ireland
Alter: 55
Homepage: motorhomecraic.com
Beiträge: 555
Dabei seit: 10 / 2004
Betreff:

Moved server - time wrong

 · 
Gepostet: 12.09.2017 - 01:07 Uhr  ·  #1
Hi,

I moved to a new server and now i cannot get the time right. I have asked the hosters and they say the time is right on the server. It was an hour behind, now after trying to change it it is now over an hour ahead. :/

Any ideas? :)
cback
Admin
Avatar
Geschlecht:
Herkunft: Saarland
Alter: 38
Homepage: cback.net
Beiträge: 17612
Dabei seit: 12 / 2003
Betreff:

Re: Moved server - time wrong

 · 
Gepostet: 12.09.2017 - 12:32 Uhr  ·  #2
Hi Ally!

Time Problems are mostly Server Related problems: Its not only the time you have on your server, its also the timezone/dst Settings you have in your Server OS and PHP Environment (Readable with date_default_timezone_get()).

What happens in your case is, that your Server/PHP Timezone Settings seems to be different to your Board-Timezone Settings.

Normally this is what happens:
You set in ACP -> General Configuration the Timezone and DST Setting your Board (and therefore Server) should have by default. This should be the same Timezone as your Server. Every User can set his own timezone in Usercp -> Settings.

What the board does is basically generate a regular UTC Value from each time in the board and add / substract the User Setting from it, so people from other regions can set the board times into their own Timezone. This is realized with normal PHP Commands so there's no huge magic behind that.


If your Server/PHP Timezone Setting is different it can be that the Server Time itself is correct and even the value you get if you just dump out the unaltered timestamp with time();

But in case of the CF3 or CF4 Board the times could be different because the calculation for the UTC (or called GMT sometimes) Value will be wrong.


Little example for better understanding:

Let's say I have a Server in Germany wich currently has GMT+1 and DST (so basically UTC +2 hours).
Now I move the Server to London (with Summertime, so UTC +1 I guess?) and my time is wrong. I set the time 1 hour back to fix it but I leave the Timezone-Setting to Germany.
Now my Server of course shows me the correct time, but it still thinks it needs to substract another hour to reach the UTC Value because the system doesn't know that I switched the timezone.


So you have 2 Possibilities to fix it:

In ACP -> General Configuration you could set a "wrong" Timezone wich compensates the difference you currently have in the board because then the board-timezone would fix the wrong server-timezone. Since only the Admin sees the setting here nobody would notice, but it would be basically fixing it at the wrong place. If you're one hour too far I think your server just doesn't have the DST Setting active, so disabling that would correct the times in your board but not the PHP Environment configuration itself wich should normally match your location.

Other (and better) option is, that your hoster sets the server timezone / PHP Regional & Timezone Settings so that your board shows the correct time again. So everything is in sync again. Wrong Timezone Settings on the Server can affect other systems too. WordPress for example does the time calculation the same way the CF does as far as I know.


Sincerely,
Chris
Douzeper
Benutzer
Avatar
Geschlecht:
Herkunft: Antrim, Northern Ireland
Alter: 55
Homepage: motorhomecraic.com
Beiträge: 555
Dabei seit: 10 / 2004
Betreff:

Re: Moved server - time wrong

 · 
Gepostet: 12.09.2017 - 21:36 Uhr  ·  #3
Thanks Chris, I have passed on your words of wisdom to my hosters and hopefully they will change the time.
cback
Admin
Avatar
Geschlecht:
Herkunft: Saarland
Alter: 38
Homepage: cback.net
Beiträge: 17612
Dabei seit: 12 / 2003
Betreff:

Re: Moved server - time wrong

 · 
Gepostet: 12.09.2017 - 22:51 Uhr  ·  #4
You're welcome, I hope they can fix it!

I mean I could also give you a little codechange for the time-function to compensate the time diff in your board but that would be a bad solution I think. This would basically just work around non-working PHP Time Functions so ... it would be definitely better if your hoster fixes this. :)

Sincerely,
Chris
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.