timeflux / timeflux_ui

Timeflux web app engine
MIT License
11 stars 4 forks source link

Monitor smoothie charts require UT data but timeflux uses local time #10

Closed jonathanjfshaw closed 2 years ago

jonathanjfshaw commented 4 years ago

Timeflux generally uses now() which returns local time.

But if my source data is timestamped at with Pandas timezone-naive timestamps in my local timezone (BST = UT + 1) then my smoothie charts are blank (although they are validly scaled so the data is reaching the web app).

I believe this is because smoothie expects timestamps to be in UT timezone. In its docs in the examples it uses javascipt's getTime() which returns UT.

If using local time is the timeflux convention, then we need to convert to UT in either ui.py or in the monitor.js

mesca commented 4 years ago

It is assumed that all timestamps are UTC. On my machine, now() returns a UTC datetime:

from timeflux.helpers.clock import now
now()

Do you encounter a different behavior?