Joomla timezone different from MySQL timezone
In Joomla I've correctly set my timezone to Eastern Time. I'm running my server locally with xampp. I can see that in my php.ini that my date.timezone is set to America/New开发者_StackOverflow_York, also Eastern Time. However, somehow, whenever anything is modified in Joomla, the time that appears in the database for modified is 5 hours ahead.
I don't know Joomla in depth, but this looks like it's by design:
Time Offset: Identifies the time zone in which the web site is to operate. The time offset is set in hours +/- between the web site location and UTC (Universal Time Coordinated - formerly referred to as GMT (Greenwich Mean Time)). Select the time zone from the drop down list.
Joomla seems to store UTC dates internally, and to calculate the difference when outputting data. So unless there are wrong dates visible in the front-end, I think this is fine.
Your MySQL timezone is probably off. Whenever your script calls MySQL date/time functions like NOW() it will use the MySQL time. You can see what the current timezones are set to by running this query SELECT @@global.time_zone, @@session.time_zone;
.
Read more about it here
精彩评论