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

matomotimestamp bug #12819

Closed
Vinutab opened this issue May 4, 2018 · 5 comments
Closed

matomotimestamp bug #12819

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

Comments

@Vinutab
Copy link

Vinutab commented May 4, 2018

Hi,

One of our application is integrated with Matomo. We have pulled the report for the visitor log and we can see the timestamp under action(timestamps are 1525255391 and 1525255392).
The report file also contains the values firstActionTimestamp (1525248191) and lastActionTimestamp (1525248192) for the visit.
Comparing firstActionTimestamp to the timestamp of the first action (and lastActionTimestamp to the timestamp of the last action) results in a difference of 7200 seconds, which corresponds to the local time zone offset. below is the code.

[
{
"idSite": "",
"idVisit": "",
"visitIp": "",
"visitorId": "",
"actionDetails": [
{
"type": "action",
--
"serverTimePretty": "May 2, 2018 10:03:11",
"pageId":
"timeSpent": "1",
"timeSpentPretty": "1s",
"generationTimeMilliseconds": "72",
"generationTime": "0.07s",
"interactionPosition": "1",
"icon": null,
"timestamp": 1525255391
},
{
"type": "event",
"--
"serverTimePretty": "May 2, 2018 10:03:12",
"pageId": "",
"eventCategory": "",
"eventAction": "",
"interactionPosition": "1",
"timestamp": 1525255392,
"icon": ""
}
],

--
"serverDate": "2018-05-02",
"visitServerHour": "8",
"lastActionTimestamp": 1525248192,
"lastActionDateTime": "2018-05-02 08:03:12",
"serverTimestamp": 1525248192,
"firstActionTimestamp": 1525248191,
"serverTimePretty": "10:03:12",
"serverDatePretty": "Wednesday, May 2, 2018",
"serverDatePrettyFirstAction": "Wednesday, May 2, 2018",
"serverTimePrettyFirstAction": "10:03:11",

}
]

Could you please help with this.

Regards

@sgiehl
Copy link
Member

sgiehl commented May 4, 2018

I guess that's caused by timezones. Which timezone did you choose for the website in Matomo? Matomo internally uses UTC, but converts the timestamps to your choosen timezone in some cases...

@Vinutab
Copy link
Author

Vinutab commented May 4, 2018

Hi,

We are using the Time zone: Europe/Zurich.

@Vinutab
Copy link
Author

Vinutab commented Jun 6, 2018

Hi sgiehl,

Thank you. We have changed the Timezone to UTC and it's working as expected.

Regards

@Vinutab Vinutab closed this as completed Jun 6, 2018
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Aug 28, 2018
@rtyshyk
Copy link

rtyshyk commented Mar 26, 2019

Why the issue has been closed?
unixtimestamp is always in UTC / GMT+0. Why timezone has an influence on timestamp?

@rudyzeinoun
Copy link

Why the issue has been closed?
unixtimestamp is always in UTC / GMT+0. Why timezone has an influence on timestamp?

That is true. As a workaround to compare dates when using the API, I am using PHP's "gmmktime" and giving it the current time in my timezone. This is messy. Unix timestamps are always "UTC+0" as you said.

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

5 participants