I have saved data from the Custom Model to mt DB using the following query
UPDATE signature
SET signature = {{Custom1.model.signature}},
name = {{Custom1.model.printName}},
timestamp = CURRENT_TIMESTAMP,
note = {{Custom1.model.note}}
WHERE id = {{contactQuery.data[0].id}}
The datatype of timestamp is TIMESTAMP
When I run a query to fetch the data, the query returns the saved timeStamp.
I then use a JS Script to format the timestamp to then enter back into a different custom Widget.
The JS output of the timestamp though is the current timestamp of when the JS was run, rather than the saved timestamp pulled by the query.
the section handling the timestamp
const formattedTimeStamp = moment(item.timeStamp).isValid()
? moment(item.timeStamp).format('YYYY-MM-DD HH:mm:ss')
: 'N/A';
console.log("Formatted timeStamp:", formattedTimeStamp);
Is there something I need to ammend in order to handle this correctly? I have tried multiple differnet variations and also got chatGPT involved but no joy