Live API: lastMinutes is modified by timezone #3925
Labels
Bug
For errors / faults / flaws / inconsistencies etc.
worksforme
The issue cannot be reproduced and things work as intended.
When calling the API in PHP, the value of the lastMinutes parameter is affected by the timezone of the calling code.
In this one instance where the site is running in the Europe/Paris timezone, if lastMinutes < 120, the API will always return 0 visits. This is obviously because the visits are stored in UTC and the calling code is 2 hours ahead of UTC (CEST). By requesting lastMinutes = N + 120, I get the corresponding visits for the last N minutes.
This bug/feature is undocumented and should definitely be handled by the API.
This happens regardless of whether the API is called by including Piwik's index.php or not (ie. including Loader.php + using more define()s etc.)
Keywords: API Live
The text was updated successfully, but these errors were encountered: