Page 2 of 2
Re: Forum Clock - time of posts
Posted: 18 Nov 2011, 8:22am
by Mick F
Audax67 wrote:Looks like a phpBB bug.
Could be.
I was just surprised by the phenomenon.
If, for instance, I was on holiday in the Maldives, and I checked into the forum, all my posts would look like they'd been posted in the middle of the nights instead of the middle of the days!
Re: Forum Clock - time of posts
Posted: 18 Nov 2011, 1:28pm
by Edwards
If I am not logged in the clock is an hour fast. When I log in it changes to the correct time
Re: Forum Clock - time of posts
Posted: 21 Nov 2011, 5:57pm
by admin
Alex L wrote:Some of these faults are probably also related to the way that date/time is calculated.
Yes, that's the problem, phpBB3 was written some time ago, when PHP's date handling wasn't as mature as it is now. phpBB3 merely adds or subtracts hours, depending on the user's timezone setting, from all dates and times (which are stored as unix timestamps).
Alex L wrote:There isn't current time as such. It is just how many seconds have elapsed since midnight 1970.
Current time in computing is taken to be UTC (
http://en.wikipedia.org/wiki/Coordinated_Universal_Time) and this includes leap seconds (
http://en.wikipedia.org/wiki/Leap_seconds). Computers than have timezone databases (
http://en.wikipedia.org/wiki/Tz_database) that allow you to calculate local times taking into account your timezone, the time of year, and any daylight savings time changes in your zone.
Seconds since the 1 Jan 1970 is just one way of storing times, known as the Unix timestamp. This works fine for the sorts of dates and times we're using in the Forum (although it doesn't handle leap seconds). But that's not the problem, because for a given timestamp and the TZ database it is possible to calculate the time (taking daylight savings into account) in any local timezone (plus or minus a leap second or two). It's just that phpBB3 doesn't use the newer PHP functions that perform these calculations with the TZ database information.
Re: Forum Clock - time of posts
Posted: 21 Nov 2011, 5:59pm
by admin
Edwards wrote:If I am not logged in the clock is an hour fast. When I log in it changes to the correct time
Aha, I needed to set the default timezone to not use daylight savings. Should be displaying in GMT when you're not logged in now.
Re: Forum Clock - time of posts
Posted: 21 Nov 2011, 6:24pm
by Edwards
The clock now is the same when logged in or not.
I hope this helps.
Re: Forum Clock - time of posts
Posted: 21 Nov 2011, 7:28pm
by Alex L
admin wrote:Seconds since the 1 Jan 1970 is just one way of storing times, known as the Unix timestamp. This works fine for the sorts of dates and times we're using in the Forum (although it doesn't handle leap seconds). But that's not the problem, because for a given timestamp and the TZ database it is possible to calculate the time (taking daylight savings into account) in any local timezone (plus or minus a leap second or two). It's just that phpBB3 doesn't use the newer PHP functions that perform these calculations with the TZ database information.
Very true, however, any servers I've worked with have been Unix based. Forgot however that CTC most likely used Windows. Plus I'm used to vBulletin as opposed to phpBB3 so my knowledge there is lacking.
Re: Forum Clock - time of posts
Posted: 23 Dec 2011, 3:45pm
by admin
Heh, CTC is quite Microsoft-based internally, but this Forum runs on a proper Linux box

The problem is 100% caused by phpBB3, nothing else.
Re: Forum Clock - time of posts
Posted: 19 Sep 2012, 11:44am
by admin
You'll all be pleased to hear that I've now installed the "Automatic Daylight Savings Time" modification to this forum.
Now you'll see that your timezone settings use cities (e.g. Europe/London) instead of fixed hour offsets. The mod makes use of this setting along with the Linux timezone database to display times. The timezone database knows about daylight savings time changes for each timezone, so the times will automatically be correct in winter and summer.
A quick test suggests that the modification is working well, but do let me know if you spot any problems with the times being displayed on the Forum.