Timezone within table data is changing when System date and Timezone is changed

I have a table wherein i am fetching a date from the database the type of it within database is timestamp and then i am converting it to render as date and the date format i am passing as (D MMM YYYY, HH:mm:ss Z) .

Initially the default i am getting dates as this 2025-04-12 22:33:05 +05:30 But the Moment i change the System date to something lets say something to this

image

then the date is changing to 2025-04-12 22:33:05 +08:00

I don't want this to happen how can i achieve this ??

I tried adding a transform script when i am fetching data via named query but it didn't work for me.

What database brand is this? Is the column type in the DB preserving the timezone information (or otherwise preserving the "instant in time")?

Your problem is commonly associated with the datetime column type in MS SQL Server. You should use datetime2 column type instead, if that is the case. Similarly, if using PostgreSQL, use the timestamptz column type instead of the simple timestamp column type.

Its PostgreSQL , And sorry yes we are using timestamptz and not the simple timestamp

No the DB is not preserving timezone information just the time
these are some sample dates stored


even though its timestamptz still i am facing the same issue when system timezone is changed it is changing the timezone always.

Correct, timestamptz doesn't save the inserted timezone. It always saves UTC timestamp for whatever was inserted. On SELECT, It always delivers that same "point in time" in whatever timezone the requestor is using. In JDBC, that delivers a java.util.Date (or java.sql.Timestamp, a subclass) at that UTC point in time, which then stringifies to whatever timezone the JVM is using.

No, the Ignition date object doesn't have a timezone. It carries UTC always. That object is stringified in whatever timezone is present when printed, logged, or deliberately formatted. Changing the system timezone changes the zone used for default stringification. Your DB data is correct. Your display/print/formatting operations are broken--don't use default stringification.

Please read this entire topic: