PostgreSQL how to convert t_stamp (bigint type) into PST timestamp (Resolution)

I am trying to convert the t_stamp column to US Pacific datetime (from a historical data table)
I have been trying to use an examples from this page https://www.appsloveworld.com/postgresql/100/10/how-to-cast-bigint-to-timestamp-with-time-zone-in-postgres-in-an-update
So far, this is working for me:

Does anyone know of a better approach?

Looks correct to me. You're converting from a Java epoch timestamp (an unzoned instant-in-time, in milliseconds) to a Postgres timestamp-with-timezone (also representing an instant-in-time, at UTC), to a local timezone.

What do you think is wrong with what you have?

1 Like

Hi. Thank you. Acually, this post was more like a resolution. But I was curious if there's still a better way. Thanks for your response.

1 Like

Yes, just convert it to a timestamp without selecting a timezone. to_timestamp() yields a timestamptz, which will be handed over to Ignition efficiently and correctly, for Ignition to handle timezones naturally, on a client-by-client basis.

2 Likes

Hi. Noted. Thank you very much for your help.