Loving Node-Red and that I have a dashboard table pulling from a DB using only 2 lines of code.
I grab sensor data from various ESP32 nodes via MQTT and stick them in a MariaDB.
I have Node Red running on a Rasberry PI V1.2.6
Time is stored as a standard Linux TimeStamp format in the DB.
Simple table and phpmyadmin displays it as:
TimeStamp Source Topic DataValue
2021-01-28 15:00:29 frontdoor temperature 31
- many rows.
Note that phpmyadmin converts the TimeStamp to my TimeZone for an easy to read format.
Then in node-red function node I have:
msg.topic = 'Select * FROM sensors ORDER BY TIMESTAMP DESC LIMIT 12;';
I connect this function node to a mysql node then to the UI_Table and all works great and
was very simple/clean. Display is just like the table above except the TimeStamp is displayed in UTC which is hard to read. ie. 2021-01-28T20:53:30.00Z
Is there an easy way in this stream to convert the Timestamp to display using my TimeZone NY.
This is what is fed to the table:
[0 … 9]