I have a bulk upsert query for my table.
and what I want to do is update the
updated_at timestamp to the current UTC timestamp.
so I wrote this JS map
row.updated_at = moment.utc()
moment.utc() does not work and I get error:
Unexpected token F in JSON at position 0
other functions like
Date.now() works fine.
Can any one please help?
Hey @gal_polak, welcome to the community
Thank you very much for welcoming me, I'm an old user that came back
Maybe you can explain why? just to expand my knowledge
Welcome back then :))
.utc() returns an object, while
.format() returns a string. The
new Date() is also an object, however a
Date object. To get a native
Date object returned from moment you'll have to use
I had the same issue previously and figured that out.