Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: What defines the output format of a Postgres Timestamp

by kikuchiyo (Friar)
on Jan 26, 2021 at 09:50 UTC ( #11127464=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127464]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-08-18 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?