SQL Error when displaying todays statistics

I have just made a new installation of 0.5.4 which has been running for a few days.
Most things seem to work very well. I can display data for any pervious day or week.
Except if I select “Day” the current date instead of yesterday in the Dashboard date picker pop-up, I get the following error in the “Last Visits Graph” widget:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)
AND name IN ( ‘nb_visits’ )’ at line 3

… and “No data for…” messages in all the other widgets.

I’m kind of surprised that I wasn’t enable to find anyine else with the same problem. I felt really sure it was a bug since the installation works well in all other respects.

That’s a symptom of your MySQL server and PHP configuration timezones being mismatched.

You should have received a warning during installation.

It appears you are correct, although if there was a warning at installation it was so tiny as to be completly unnoticeable…

I have MySQL TZ=CET and PHP date.timezone=UTC.

But how do I fix this??

I do not have control over the server, the settings are made by my hosting provider. So I can’t change the system php.ini or the MySQL system timezone. I could potentially change the MySQL client connection timezone, but that would require hacking into the Piwik code for all connections being made, which seems a little difficult…