I have these queries
CREATE TABLE times (
time TIMESTAMP
);
insert into times values(now());
select * from times;
time
---------------------------
2021-01-05 15:25:55.170
(1 row)
What I would like is this timestamp formatted with UTC similar to how java formats UTC timestamps (java.time.Instant.now()) 2021-01-05T15:25:55.170Z
.
and what I could do is manually format the string like so
select replace(time::text, ' ', 'T') || 'Z' from times;
but is there a more conventional / cleaner way of achieving this timestamp format?