Due to requiring some highly customized reports, we have to generate our reports directly from Matomo's database(a Maria DB instance). The thing is, in table matomo_log_link_visit_action server_time field is being written in UTC. And we need it to be in our time zone. To solve this issue, we have modified core/bootstrap.php and changed @date_default_timezone_set('UTC') to @date_default_timezone_set('Our time zone');. It corrects our generated reports but we have to do modification in website settings so that dashboard and other Matomo's application generated reports be correct either.
Is there any other way to do this?
Sorry there is no other way. Maybe you could leave it as UTC and apply instead some MySQL function to get correct date when you build your report.
As @jsoltani said, we have modified @date_default_timezone_set. Now in Vistors>Times we have the following:
As you may see, "hour (Start of visit) is "16"" which is correct. But the visit listed below it, is shown to be on 20:25:17 which is not correct. It must be 16:05:17. How can I correct this inconsistency?
cheers @Mr-Norrell I don't think we can do / will do anything here as it would require likely major changes in Matomo. I can only recommend to leave it at UTC as anything else is not supported, not tested, ... out of curiosity... how come you are setting a different timezone? Are you also accessing DB directly re raw data? If you, I suggest you apply a timezone directly in the mysql queries.