PostgreSQL/Date Timezone/DATESTYLE
Содержание
Displays the current date formatting style
<source lang="sql">
postgres=# -- Displays the current date formatting style: postgres=# postgres=# SHOW DATESTYLE;
DateStyle
ISO, MDY
(1 row) postgres=#
</source>
SET DATESTYLE TO NONEUROPEAN, GERMAN
<source lang="sql">
postgres=# postgres=# -- Setting date formats postgres=# postgres=# SET DATESTYLE TO NONEUROPEAN, GERMAN; SET postgres=# postgres=# SHOW DATESTYLE;
DateStyle
German, MDY
(1 row) postgres=#
</source>
Sets the date and time formatting to ISO
<source lang="sql">
postgres=# postgres=# -- Sets the date and time formatting to ISO: postgres=# postgres=# SET DATESTYLE TO ISO; SET postgres=# postgres=#
</source>
Sets the DATESTYLE variable to use traditional PostgreSQL style formatting
<source lang="sql">
postgres=# postgres=# -- Sets the DATESTYLE variable to use traditional PostgreSQL style formatting. postgres=# postgres=# SET DATESTYLE TO Postgres,US; SET postgres=# postgres=#
</source>
Setting date formats
<source lang="sql">
postgres=# postgres=# -- Setting date formats postgres=# postgres=# SET DATESTYLE TO ISO,US; SET postgres=# postgres=# SHOW DATESTYLE;
DateStyle
ISO, MDY
(1 row) postgres=#
</source>