Those two times are the same. It's just a difference in formatting. "+05:30" means a 5 and a half hour time zone offset. "Z" means GMT aka UTC time. I suggest you convert on the client side to whatever time zone you want, not rely on the database to do that.
Confusingly, neither timestamp with time zone
(aka timestamptz
) nor timestamp
actually stores a time zone, but that's better really. You should probably use timestamptz
; see here.
According to the official Postgres docs: "For timestamp with time zone, the internally stored value is always in UTC (Universal Coordinated Time, traditionally known as Greenwich Mean Time, GMT). An input value that has an explicit time zone specified is converted to UTC using the appropriate offset for that time zone." "When a timestamp with time zone value is output, it is always converted from UTC to the current timezone zone, and displayed as local time in that zone. To see the time in another time zone, either change timezone or use the AT TIME ZONE construct (see Section 9.9.3)."
So probably your machine's local timezone is set to UTC.