Re: How to get DATE in server locale format - Mailing list pgsql-general

From Leif Biberg Kristensen
Subject Re: How to get DATE in server locale format
Date
Msg-id 201001110943.36723.leif@solumslekt.org
Whole thread Raw
In response to How to get DATE in server locale format  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
On Sunday 10. January 2010 22.57.38 Andrus wrote:
> Server lc_times contains non-US locale.
>
> SELECT CURRENT_DATE::TEXT
>
> still returns date in format YYYY-MM-DD
>
> How to get date in server locale format ?

Pg doesn't care about lc_times.

http://www.postgresql.org/docs/current/static/datatype-datetime.html#datatype-
datetime-output2-table

pgslekt=> SELECT CURRENT_DATE::TEXT;
    text
------------
 2010-01-11
(1 row)

pgslekt=> set datestyle to german;
SET
pgslekt=> SELECT CURRENT_DATE::TEXT;
    text
------------
 11.01.2010
(1 row)

regards,
--
Leif Biberg Kristensen
http://solumslekt.org/

pgsql-general by date:

Previous
From: Yan Cheng Cheok
Date:
Subject: Custom Field for a table row returned from stored procedure
Next
From: "A. Kretschmer"
Date:
Subject: Re: Custom Field for a table row returned from stored procedure