http://qs321.pair.com?node_id=11127464


in reply to What defines the output format of a Postgres Timestamp

See https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT, especially the notes about ISO 8601.

It appears that formatting happens on the server, and you can influence it with the SET datestyle command, but there aren't that many options. If you want some other fancy format, you have to use to_char.

(I'd also like to point out that Postgresql's documentation is exemplary in general: it's well-structured, detailed, searchable, and best, versioned. It's usually the first and last place to look for if you have any questions about Postgresql.)

  • Comment on Re: What defines the output format of a Postgres Timestamp

Replies are listed 'Best First'.
Re^2: What defines the output format of a Postgres Timestamp
by Skeeve (Parson) on Jan 26, 2021 at 12:04 UTC

    Thanks. I already found that.

    Unfortunately ISO8601 and RFC3339 differ a bit. RFC3339 expects a minute part in the UTC offset while ISO8601 can live without it.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e