# [rrd-users] Showing daily average ; from midnight to midnight local time

Jean-Yves Avenard jyavenard at gmail.com
Wed Dec 9 01:27:41 CET 2009

```Hi there...

Ok, I have finally the hang of most of what I intended to do.

Logging my power usage ; then calculating power consumption as charged
by the electricity company (in kWh).

http://htpc.avenard.org/power/

For each graph; you can click on a part of the graph ; and it goes
down to one resolution down (e.g weekly view gives you daily view
etc...)

For the power usage ; I want to show the data as follow:
daily: midnight to midnight local time
weekly: midnight of day -7 to midnight previous day local time
monthly: midnight of day-30 to midnight previous day local time
yearly: doesn't really matter.

daily view is averaged per hour
weekly view is averaged per day
monthly view is averaged per day
yearly view is averaged per month (30 days)

I created the RRD with data being fed every minute and keeping
consolidated data as follow:
100 days of 1 minute average
5 years of 5 minutes average
5 years of 30 minutes average
5 years of 1 hour average
5 years of 2 hours average
5 years of daily average

Everything is nice and rosy but for the weekly and monthly view...
The average isn't calculated from midnight to midnight local time ;
even though I provide end and start data at those values.

For the weekly view, the x-grid is 'HOUR:3:DAY:1:HOUR:24:86400:%a'
As you can see on the weekly graph:
http://htpc.avenard.org/power/?graph=2&view=week
A plot doesn't start at midnight ; but around 11AM.

I understand that this is UTC time ; I read
http://www.vandenbogaerdt.nl/rrdtool/timezone.php and in particular

Is there any way to make the plotted bar goes from midnight to
midnight local time, and calculate the average of the data of a day
(local time)?
If I set TZ to UTC ; then obviously the x axis matches the graph
perfectly ; but that's not what I want to do...

Thank you...
Jean-Yves

```