Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

289
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda