Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database action_visit_log time zone #13721

Closed
jsoltani opened this issue Nov 17, 2018 · 5 comments
Closed

Database action_visit_log time zone #13721

jsoltani opened this issue Nov 17, 2018 · 5 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@jsoltani
Copy link

Hi there,
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?

Thanks

@tsteur
Copy link
Member

tsteur commented Nov 17, 2018

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.

@tsteur tsteur closed this as completed Nov 17, 2018
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Nov 17, 2018
@Mr-Norrell
Copy link

@tsteur
As @jsoltani said, we have modified @date_default_timezone_set. Now in Vistors>Times we have the following:
image
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?

@tsteur
Copy link
Member

tsteur commented Dec 1, 2018

Where did you modify date_default_timezone_set @Mr-Norrell ?

@Mr-Norrell
Copy link

@tsteur
In core/bootstrap.php:35

@tsteur
Copy link
Member

tsteur commented Dec 2, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants