MySQL's UNIX_TIMESTAMP function interprets the date using MySQL's
configured timezone, which we don't want (may be misconfigured etc).
Instead, now we do the conversion to a timestamp on the PHP side. Then
JavaScript is given the offset between UTC and the configure timezone
so it can work out how to display the data.
This fix ensures that before aggregating daily/hourly statistics, dates
are converted into the local timezone ("flarum-statistics.timezone" in
the settings table).