Timestamps

0
I have discovered that the timestamps on the logins displayed in the admin area are exactly 5 hours behind our current time.

My Joomla server time is set to Detroit and my hosting company sets the server to central standard time, so I can't figure out the 5 hour difference.

Do you have any ideas?
Responses (9)
  • Accepted Answer

    Thursday, October 04 2012, 02:40 PM - #Permalink
    0
    hello,

    this means your server is located 5hours behind your location. in other words, your server's timestamp is 5hours behind of you. the stats record each entry based on the server's timestamp (of course!)

    when you say "your joomla server time" is set to Detroit, you mean this is a joomla parameter? the timestamp used is always the server one, so... really the first thing I can say is: your server timestamp is not what your hosting company says it is.. is that possible?

    by the way: the timestamp is actually recorded by the MySQL system (not PHP). with this I mean that maybe the PHP settings are set to central standard time, but it could be that the MySQL settings are setted differently (5hours behind). could you check this?

    thanks! :)

    Germi
    The reply is currently minimized Show
  • Accepted Answer

    François
    François
    Offline
    Saturday, October 06 2012, 02:04 PM - #Permalink
    0
    If you host server provider allows you to set a personalized php.ini file, you have to set here the correct timezone managment (which is absentee at most of the mutual hosting providers using Plesk, CPanel...)

    If you can't do that properly, the solution consists in adding at the end of

    /includes/defines.php

    and

    /administrator/includes/defines.php

    the following line :

    date_default_timezone_set( 'Europe/Paris' ) ;

    (that's for me, for you, set your own timezone, here is the official list

    www.php.net/manual/fr/timezones.php )

    Hope I understood correctly the subject and hope that can help ?!
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, October 06 2012, 03:13 PM - #Permalink
    0
    that will NOT help because the issue here is the Timestamp of the MySQL server! NOT the PHP one!
    PHP and MySQL are two separate things.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, October 06 2012, 04:42 PM - #Permalink
    0
    After an hour with a tech support person at my hosting company yesterday, he said that the php server and the mysql server were set to CST time and that he can't manually adjust them. He tried using the htaccess file as I had but it didn't work any better for him than it did me. He had no explanation for the 5 hour difference when there is only a 1 hour difference between EST and CST. He even checked my joomla settings and confirmed my setting were correct.

    I guess I am stuck manually adjusting the time.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, October 07 2012, 10:33 AM - #Permalink
    0
    there is still another thing you can try:
    open file /plugins/system/contentstats/contentstats.php and add this into line 411:

    $fivehours = time() + (5 * 60 * 60);
    $this->date_event = date('Y-m-d H:i:s', $fivehours) ;
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, October 09 2012, 06:08 PM - #Permalink
    0
    Okay, I did that and it has gotten me to within an hour of my local time. It was 4:09 when I logged in and the timestamp said 17:09, so we are much closer.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, October 09 2012, 06:38 PM - #Permalink
    0
    well then just replace that "5" for a "6"!! like so:

    $fivehours = time() + (6 * 60 * 60);
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, October 09 2012, 08:42 PM - #Permalink
    0
    Perfect! Thank you very much for your help!
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, October 13 2012, 11:24 AM - #Permalink
    0
    The modification in /plugins/system/contentstats/contentstats.php worded fine for me.

    Thank
    The reply is currently minimized Show
Your Reply