How to insert node Date() into postgresql timestamp column?

Viewed 8930

I want to update several records with the same time, and I can't figure out how to do it.

I've tried various combos with pg-promise and moment and node alone:

myTs = Date();
myTs = moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); 

with sql:

UPDATE mytable set ts = $1;
UPDATE mytable set ts = $1::timestamp;

errors:

 time zone "gmt-0800" not recognized
0 Answers
Related