Domanda

I am using python-rrdtool to generate graphs from rrd files, it is by default generating graphs in CST time zone. How can i change the default time zone to UTC.

I found that setting the TZ env variable can do the trick. How can i do this using python-rrdtool ?

I followed this tutorial to create graphs using python-rrdtool

Thank You

È stato utile?

Soluzione

Never mind, I found the solution,

To set the TZ variable using python, you need to add the below lines to your python script where you are generating your rrd graphs -

import time, os
os.environ['TZ'] = "Asia/Kolkata"   # timezone you want to display graphs in
time.tzset()
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top