@cmt-all opened this Issue on March 30th 2016

The following log is imported.

10.10.20.216 - - [06/Jan/2015:08:59:59 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.217 - - [06/Jan/2015:09:00:00 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.218 - - [06/Jan/2015:09:00:01 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.216 - - [07/Jan/2015:08:59:59 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.217 - - [07/Jan/2015:09:00:00 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.218 - - [07/Jan/2015:09:00:01 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"

Then I ran the following command.

console core:delete-logs-data --dates=2015/01/06,2015/01/07
console core:invalidate-report-data --dates=2015-01-06

As a result, following data remains in the visitor log.

10.10.20.216 - - [06/Jan/2015:08:59:59 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.217 - - [07/Jan/2015:09:00:00 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"
10.10.20.218 - - [07/Jan/2015:09:00:01 +0900] "GET /test.html HTTP/1.1" 200 317 "-" "Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0"

This command ("console core:delete-logs-data") does not consider the time difference from GMT.

We are running our server at JST (GMT +900).
Piwik version is 2.16.0.

@Starker3 commented on January 28th 2021

It seems that the console core:delete-logs-data is still using UTC when deleting data.

If it uses UTC, how would someone delete the visits for a specific day for a website that is not UTC?

For example if we have a website in NZ with +12/13 and we delete the data for one specific day, it will only delete half of the data, and the other half it deletes would be for the wrong day.

At present the only way to correct this using the command for a website that is not UTC would be to specify the times in UTC for the data we want to delete, for example:
./console core:delete-logs-data --dates="2015-01-01 05:00:00,2015-02-01 05:00:00" --idsite=42

It would be better if the core:delete-logs-data used either the Matomo server time, or the website/measurable's timezone to delete data, since this is how the data is presented in Matomo.

Powered by GitHub Issue Mirror