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
BIGINT
instead ofTIMESTAMP
. Is that correct? If it is, you'll need to store your date in a numeric format and not as an ISO date string. – Cudliptimestamptz
as the database column type, and insert JavaScript typeDate
directly. It just will work, and correctly. – Hach