Piwik Archive Strange Behaviour

Hello

I’m having some problems with archives in Piwik. Piwik seems to be producing incorrect numerics when requesting archives in a month period.
The screenshot belows shows 20 page views and 3 visitors recorded in the last hour (2014-04-04 14:00). These are the only page views in the database.

[attachment 1687 Capture.PNG]

I have a plugin which gets the page views, visitors and unique visitors from the archive.


$archive = Archive::build($idSite, $period, $date);
        
printf("%d\n", $archive->getNumeric(array('nb_actions')));
printf("%d\n", $archive->getNumeric(array('nb_visits')));
printf("%d\n", $archive->getNumeric(array('nb_uniq_visitors')));

When I use the parameters 2, ‘year’, ‘2014-01-01’ I get the following output - which corresponds with that in the Piwik screenshot.

Year for 2014-01-01:
float(20)
float(3)
float(0)

When I use the paramters 2, ‘month’, ‘2014-01-01’, I get the following output - which is clearly not correct - since this data is shown for 4th April in the Piwik screenshot.

Month for 2014-04-01:
float(0)
float(0)
float(0)

The same is similar for the first week of the month April in 2014 - except the output shows 3 visitors, 3 unique visitors and no page views.

Week for 2014-04-01:
float(0)
float(3)
float(3)

Finally for today, the ouput shows 1 visitor and 1 unique visitor, and no page views.

Day for 2014-04-04:
float(0)
float(1)
float(1)

How can this be so inconsistent?

When I use the paramters 2, ‘month’, ‘2014-01-01’, I get the following output - which is clearly not correct - since this data is shown for 4th April in the Piwik screenshot.

The data for april should be ‘2014-04-01’

Sorry that I was a typo in my post.

I am actually using ‘2014-04-01’ - I had just written ‘2014-01-01’ in this thread by accident.