What kind of database are you using ?
It could be solved in either javascript or in your database. Some databases have extensive support for timezone conversions.
It is almost always a bad idea to put local time into a database. For example, over a DST change you may have multiple records with the same timestamp. Put UTC in the database and convert it for display if necessary when you fetch it. Grafana, for example, requires timestamps in UTC.
I followed your suggestion about use moment node but because I have not excellent background on JS and I'm new at node -red I would need your valuable help.
The following is a pic of the flow which inject info into SQLlite node, afterward I'm trying to include in output message from SQLlite node my local time, here is where Moment node is inserted.
Are you storing the date and time separately in the database? Best not to do that, just save the complete timestamp and split it up later if you need to. If you want to save the current time when you write a record you can tell the database that the timestamp column should automatically be set to the current time when you write a record so you don't need to do anything else.
Yes, I'm saving the complete UTC timestamp in the database.!
My goal is use the dashboard to select a range of local date-time
then convert it to UTC timestamp to query the database. Afterward I intend to shows
that query on a HTML table in the dashboard.
As I explained you above, maybe I can use the MOMENT node to convert UTC timestamp to local with this node but I don't know how to do it.
What I really want to achieve is include every row coming from the database in the Moment node payload along with local time and show it all in a HTML table.
Hope you can Help me.
Thank you.