SMF Support > SMF 2.0.x Support

My forum time is incorrect. It's 22 minutes off.

(1/1)

Metrik:
Hi. I hope you can help me with the following problem I have using the SMF software.


* SMF version 2.0.2.
* Link to forum: (Sorry, you are not allowed to post external links).
* Error logs: Unfortunately none, I cleared them during maintenance.
Problem.
The forum time is 22 minutes ahead of correct time. I think the problem appeared approx. 2 weeks ago (running SMF 2.0 at the time). The incorrect time is displayed at the top of the login page and new posts on the forum is stamped with the incorrect time as well. I cannot relate the problem to any new mods or config changes being performed.
   
I contacted my ISP and they assured me, that their server running my domain has the correct date and time. To double check this, I placed an html time code snippet on the same web site, to see if the time was returned correctly. It was.

Switching to the default SMF Curve template does not fix the problem. I am using Argentum by Bloc.

Useful config settings for troubleshooting (perhaps):

Admin -> Features and Options -> General:
Default time format: %a %e %b %Y %H:%M:%S
Default number format: 1234,00
Overall time offset: 0 (added to the member specific option.)
Server timezone: Europe/Copenhagen

Profile -> Look and Layout:
Time Format: (Forum Default)
Time Offset: 0
Current forum time: Wed 1 Aug 2012 03:13:45

Modification Packages
1. Aeva Auto-Embed Video & Audio 7.2
2. SMF 2.0.1 Update 1.0
3. SMF 2.0.1 Update 1.0
4. SMF 2.0.2 Update 1.0
5. Remove "Last edit" mod 0.2

I tried uninstalling 1. and 5. but this didn't fix the problem.

Please provide help if you can. I am at a loss here after troubleshooting for hours.

MrPhil:
Is this just you, or do other members have this problem? Have you tried as a guest (system default time)?

An HTML script shows the correct date and time? What did you use to display date and time in pure HTML? Try repeating it with a PHP script, something like

--- Code: ---<?php echo date("Y-m-d H:i:s"); ?>
--- End code ---
If it's correct, are you sure you don't have a non-zero system or member time offset (hours)? If they are off, what PHP version? Do you have any profile or .htaccess entries concerning TimeZones or the like? Any php.ini entries such as date.timezone? I can't think of any timezone that would be 22 minutes off (unless you have a timezone name of "Etc/GMT+x.63333" [is that even legal?]), so I'm leaning towards an hour offset in SMF of x.3666666 hours.

You need to isolate the problem to the server itself (what your hosting service [not ISP] told you notwithstanding), to PHP, or to SMF (application).

Metrik:
Thanks a lot for your suggestions, MrPhil.

I put your php script on the server and it returned a time which confirmed my suspicion - the server time was off by 22 minutes. I don't recall the "html" code I put there previously to check. It might have been getting its time from another server and not locally. Sorry about that.

With the php script in hand, I contacted my ISP again and this time got to chat with a more proficient supporter. He narrowed it down to be an incorrect clock in their setup. Here's the transcript for what it's worth:

Please hold on while I check.
According to the server information, it is set to UTC. But it seems to be off indeed. Let me check further
Alright. I have reported the issue to our system developers and should be fixed in a few minutes. For the meantime, can you try setting the time to your timezone to date_default_timezone_set('Denmark/Copenhagen');
you: Why?
According to our technicians, the time is set to our UNIX time and you can just convert this to UTC to get the correct timestamp.
That is why it is off by 18 minutes which is actually the leaptime that is discarded by UTC


The issue is solved now. By the provider. Thanks again!

MrPhil:
Yeah, someone screwed up a server time setting and no one ever bothered to fix it. Next time it happens, pointedly ask your host if they use NTP to automatically synch up server times, or are they relying on someone's wristwatch?

18 minutes leaptime? Never heard of more than a second's leap time (especially for UTC).


--- Quote ---date_default_timezone_set('Denmark/Copenhagen');
--- End quote ---
Shows how much they know. That's not even a legitimate timezone (Europe/Copenhagen is).

Glad you got it sorted out in the end.

Navigation

[0] Message Index

Go to full version