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

Fix target and referer reporting when PHP and database differ on timezone #117

Merged
merged 8 commits into from
Apr 19, 2020

Conversation

sophiehuiberts
Copy link
Contributor

My hosting provider has strftime in UTC and DATE(NOW()) in Amsterdam time.
This broke top referer and top target reporting when reporting today's
top, for 1 or 2 hours per day, depending on daylight savings time.

sophiehuiberts and others added 4 commits November 4, 2018 00:49
…the date.

My hosting has strftime in UTC and DATE(NOW()) in Amsterdam's time.
This broke top referer and top target reporting when only reporting today's
top, for 1 or 2 hours per day, depending on daylight savings time.

I replaced all occurences of DATE(NOW()) in queries with calls to strftime.
Copy link
Contributor

@stklcode stklcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved the merge conflicts with #134 (which also requires "today") and slightly reworked the DB queries to use prepared statements instead of string concatenation.

Now we're using PHP server consistently. LGTM.

stklcode added 3 commits April 7, 2020 17:27
The result is equivalent with neglectable performance difference.
To not create any confusion by use of the "timestamp" which does not
return a UTC timestamp, as probably expected, but one with zone offset,
we now simply pass the format argument to current_time().
@patrickrobrecht patrickrobrecht added this to the 1.7.0 milestone Apr 13, 2020
@bueltge bueltge added the bug label Apr 19, 2020
@bueltge bueltge modified the milestones: 1.7.0, 1.6.4 Apr 19, 2020
@patrickrobrecht patrickrobrecht merged commit 738c22f into pluginkollektiv:master Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants