Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
Node Mysql Insert and Modify shorthand from object with 1 conversion

There is a very useful shorthand for Node Mysql where it automatically spreads all object values as column values like this:

'INSERT INTO `table` SET ? ;', [someobject]

or

'UPDATE `table` set ? WHERE id = ?',[someobject,id]

This is very handy as it allow for maintainable code with very large objects (30+ columns)

But one of the columns is a Timestamp value in Mysql and the data on the node app is as a Linux timestamp (integer), Mysql doesn't automatically map this integer. I usually do something like : FROM_UNIXTIME(?) to automatically convert this to a full date string on the (database) server.

How can I keep this shorthand technique with a timestamp insertion? I could modify this parameter beforehand in node, but nothing guarantees me the node server and the database are on the same timezone.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!