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

161
Vistas
Converting UTC timestamp in column to user's time in Postgres VS on client side

I have a message table schema like this (msg_id, msg_from_id, msg_to_id, msg_text, msg_time). ...and I'm thinking about the conversion of the message timestamp.

  1. Store the user's timezone in the users table, do an AT TIME ZONE = 'SELECT tz FROM users where ...' while retrieving the messages.
  2. Retrieve the data just as is and convert on the client side

What's the better approach between the two?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The simple and correct solution is to set the database parameter timezone correctly for the client session:

SET timezone = 'Asia/Kolkata';

Then the database will render all timestamp with time zone correctly for that time zone. In short, PostgreSQL can do the time zone management for you.

about 4 years ago · Juan Pablo Isaza Denunciar
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