ayeks / bme680_to_influxdb

Simple script that sends your BME680 temp, pressure, humidity and gas sensor data to InfluxDB.
MIT License
23 stars 16 forks source link

Issue with timezones #4

Closed eamkrc closed 3 years ago

eamkrc commented 4 years ago

First time posting, so sorry for bad form

Awesome script, I'm using Europe/Tallinn timezone which caused me problems with data being 3 hours in the future, influx and grafana seemed to be configured properly. Finally had to change the code in your script

line 129 old
iso = time.ctime()
my fix
iso = datetime.datetime.utcnow().strftime('%a %b %d %H:%M:%S %Y')

Maybe just a me problem but thought I would share if anyone else has similar issues with dashboards in grafana

ayeks commented 4 years ago

Hey thanks for the remark! You are more than welcome to push a pull request to that line. I am currently unable to test the script with the changes.

padalev commented 3 years ago

Same issue here. Pushed a pull request that should solve the problem.

ayeks commented 3 years ago

Thanks a lot for the pull request. It is merged know.