Link to home
Start Free TrialLog in
Avatar of Carlos Llanos
Carlos LlanosFlag for United States of America

asked on

Time is off by +5 hours on Joomla front end...but correct on backend.

Weird problem here.

Got a message saying that the website is displaying a time that's exactly 5 hours ahead of our current time, but when I check the administration side, it's the correct time.

For example:

Front side of site says: 14:00:00
Back side of site says:  09:00:00

Code for front side and back side is:
 
<?php

$date = date('H:i:s');

echo $date;

?>

Open in new window


The timezone is set to 'America/Chicago' which is my timezone  (CST), but I don't think it's working correctly...

This was working just find yesterday...and the only thing I changed was to enable Akeeba's Lazy Backup Plugin...disabled it now and still the same results.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Carlos Llanos

ASKER

Changed my scripts from:

<?php return date("H")+01;?>

to

<?php return date("H")+1;?>

This worked like a charm...thanks Ray!
Glad to help, thanks for the points.  You might also consider date_default_timezone_set(), too.
http://php.net/manual/en/function.date-default-timezone-set.php