[rrd-users] Re: time zone issue

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Sep 27 23:27:24 MEST 2005


On Tue, Sep 27, 2005 at 10:10:00PM +0200, Geoff Thornley wrote:

> The source of my recorded data is in Geneva, Switzerland. However, my 
> portal, where I record this data is in San Jose, California, USA (it could 
> also be anywhere else in the world).

Yes, this is one of the reasons why using UTC is important.


> When I graph this data via RRDtool it always has the US West coast time 
> associated with it.

A very accurate statement, possibly more accurate than you expect.

> How can I change this to my local time on the graphs that RRDtool produces?

By associating another time zone!

Do something similar as the next example.  Exactly how to do this is left as
an excercise for you, it will probably involve some RTFMing or googling.  It
may depend on your OS, your scripting language maybe, I don't know.

alex at home$ TZ=PST6PDT7 date;date
Tue Sep 27 14:19:39 PDT 2005
Tue Sep 27 23:19:39 CEST 2005


What happened?  The first command has timezone information "PST6PDT7"
associated with it.  The second command has the default (my default
that is) associated with it.

I need not change the clock, I just change the environment for the program.


The following script works for me. I actually tested it this time :)

    #!/bin/bash
    
    RT=/usr/local/rrdtool-1.2.11/bin/rrdtool
    now=$(date +%s)
    
    $RT graph test1.png \
            --end $now \
            --start end-86400 \
            DEF:ds0=test.rrd:ds0:AVERAGE \
            AREA:ds0\#0000FF:ds0
    
    TZ=PST6PDT7 $RT graph test2.png \
            --end $now \
            --start end-86400 \
            DEF:ds0=test.rrd:ds0:AVERAGE \
            AREA:ds0\#0000FF:ds0

It produces two images, the same except for the x-axis legend.

HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list