문제

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

도움이 되었습니까?

해결책

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()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top