I have a sqlite file with time series data. How can I format the text DateTime string in a way grafana will know how to use it? Here is a snapshot of the data.
what you have is good just make sure it is UTC
I am trying to use the TimeStamp column.
1 Like
is it utc
I know this post is fairly old, but I was struggling with this issue as well and evenutally end up with the query below. It includes a filter for the selected time in grafana and appears to be working. In my case, measurement_date was defined as a datetime column in my table.
SELECT battery_voltage, pv_voltage, substr(measurement_date,1,10) || ‘T’ || substr(measurement_date,12,8) || ‘+00:00’ as time
FROM controllerData
WHERE measurement_date BETWEEN datetime(${__from}/1000,‘unixepoch’) AND datetime(${__to}/1000,‘unixepoch’)
ORDER BY measurement_date DESC;