I would like to get a JSON object in Postgres that display timestamp with Australia/Sydney timezone offset (+10:00 or +11:00 during daylight saving), for example I would like json object returned with following values:
"2021-07-31T23:59:59.123456+10:00"
"2021-01-31T23:59:59.123456+11:00"
But when I use either to_json() or to_char() the timestamp value returned is UTC with offset +00:00
select to_json(current_timestamp::timestamptz),
to_char(current_timestamp::timestamptz, 'YYYY-MM-DD"T"HH24:MI:SS:MSOF')
"2021-01-31T07:47:22.895185+00:00"
2021-01-31T07:47:22:895+00
I have tried to add "at time zone 'AEDT'" but it shifts the timestamp value and keep the offset to +00:00.
Thanks.