PDA

View Full Version : Time display issue


Black Tiger
Fri 18th Apr '08, 10:16pm
We got a time display issue on our forums.

When we look at the bottom of the forums it says:
All times are GMT +2. The time now is 03:11 which is correct.

But when I make a post now, the time of the post is 21.12 which is not correct.

My time settings in my profile are correct and I'm running 3.7.0 RC3.
Furthermore this problem also occurs when using a fresh template set.

What can be causing this problem?

Steve Machol
Fri 18th Apr '08, 10:20pm
vBulletin gets its time from the server. You need to set the timezone in the Admin CP to whatever you want the default to be and the DST settings should match whatever settings are on the server.

Then each user needs to set their local timezones/DST in the User CP. If you do this correctly and the server time is correct, then the correct times will show.

This also assumes that you have not modified the footer template to affect the DST detection code in it.

Black Tiger
Fri 18th Apr '08, 10:36pm
All times are GMT +2. The time now is 03:11 which is correct.
So settings in ACP are correct.

Server is setup to GMT+1 and it makes no difference if I put Daylight savings to off or to on.

The user (also myself) have also GMT+1 and daylight savings in effect.
Server says:
za apr 19 03:31:21 CEST 2008

I administer another forum running 3.6.9 with exactly the same setup in ACP and for user and there the time display problem does not occur.
The server there also says: za apr 19 03:31:21 CEST 2008

I still don't understand. I did not modified the DTS detection in the footer template.
Problem occurs on new fresh style too.

Could it be a mod causing this?

Steve Machol
Fri 18th Apr '08, 10:38pm
Honestly vB get it's time from the server and your PC settings. It doesn't just make one up. If your settings are correct and you have not modified the code or templates, then it's a server issue.

Black Tiger
Fri 18th Apr '08, 11:22pm
Like you can see, servertime is correct, if there could be anything else (maybe in server php settings) could you tell me?

There was also an option to but some code in the global.php if I remember correctly, which disables all plugins and products.
Could't you tell me that code so I can try that too please?

Steve Machol
Sat 19th Apr '08, 12:45am
Actually I can't see what your server time is.

To troubleshoot this, first reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents':

Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

[Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.]

Next, disable all plugins.

Note: To temporarily disable the plugin system, edit config.php and add this line right under <?php

define('DISABLE_HOOKS', true);

Then if you still have this problem, create a new style and choose no parent style. This will force it to use the default templates. Finally empty your browser cache, close all browser windows then try again. Make sure you change to the new style and view your forums with it. Do you have the same problem?

Black Tiger
Sat 19th Apr '08, 12:06pm
Actually I can't see what your server time is.
You don't? It's written in my post:
Server says:
za apr 19 03:31:21 CEST 2008

But no problem, maybe you've overseen that.:)

The problem must be in a plugin, but I don't know which one because I can't deduce. I started with the following.
1.) Diagnostics: did not have strange things, only displayed my mods as being no part of vbulletin files which is correct.

2.) Disabling all Products and plugins -> did not have any effect.

3.) Disabling the plugin hook system in my ACP -> Problem gone!

So I did not even come to the point of editting the config.php file, problem is already gone when disabling the plugin hook system in the ACP.

But now I wonder... how can this happen? Why does this makes a difference while al plugins and products already are disabled?

And how can I find out now which mod is causing the problem?

Black Tiger
Sat 19th Apr '08, 12:28pm
I found the problem. This was a solution which I found somewhere here on vBulletin.
It was for integrating an add thingy. The solution was to create a plugin and hook it to the global_start hook
ob_start();
include('../ad_network.php');
echo $ad_network;
ob_end_clean();
which I integreted in the footer template this way:

[code=$ad_location[ad_footer_start]

<br />
<div class="smallfont" align="center">$vbphrase[all_times_are_gmt_x_time_now_is_y]</div>
<br />
<center>$ad_network</center><br />

$spacer_close
<!-- /content area table -->

In this ad_network.php was a timezone definition which caused the problem, thanks for the quick help!

Steve Machol
Sat 19th Apr '08, 2:00pm
Glad you found it. :)