2011-11-07, 02:08:16
gordo Wrote:I think I mn needa little advice, I asked a question a few days about adding a timestamp to news posts on my site. This is sort of linked to that, which was I think solved
Could anyone answer what exactly effects the time on a site, I have selected GMT/Europe London for my timezone. I made a news post about 5 minutes ago (15.05 pm) yet the time-stamp displays 10:02:56 AM
http://www.carrowroad.net/cnews/index.ph...ng-lambert
I am unsure what else to try, a few minutes would be such a problem, but this is several hours, I take it that it also affected by what time my host provider is on to, how would I go about finding that out.
I would really like to get this solved
As far as I know, the setting for the backend user only effects the display on the backend, while the default php/server setting influences the display on the frontend.
Create a script time.php and run it on your server:
Code:
<?php
echo "Default time zone: ".date_default_timezone_get()."<br/>\n";
echo "It is ".date('Y-m-d H:i:s T (O)')."<br/>\n";
echo "Setting time to UTC...<br/>\n";
date_default_timezone_set('UTC');
echo "It is ".date('Y-m-d H:i:s T (O)')."<br/>\n";
If the time displayed is correct, but in the wrong timezone, you might just set $TIMEZONE='Europe/London'; (or similar) in gsconfig.php (didn't try it), this will probably correct the standard get_page_date function. Otherwise try adding date_default_timezone_set('Europe/London'); (or similar) in your gsconfig.php.
If the displayed time is incorrect, it means that the server/os is set to the wrong time. You should correct this on the server.
If you can't correct it or your provider won't correct it, you have to define a (wrong) default timezone offset by the same amount (but should never display the timezone itself to the user). But I would rather change the provider, if he can't set his servers to the correct time.