Fix statistics period computing with start/end time

This fixes bug #1132732

Change-Id: I97545340ad9f49ec575e27c1a4fb4a09a3aefbf4
Signed-off-by: Julien Danjou <julien@danjou.info>
Merge "Fix statistics period computing with start/end time"