Re: Is it not datestyle that determines date format output?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Netto <rcnetto(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is it not datestyle that determines date format output?
Date: 2003-12-16 14:38:58
Message-ID: Pine.LNX.4.33.0312160734110.5679-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 11 Dec 2003, Netto wrote:

> The way PostgreSQL deals with the date format is confusing me...
> I need PostgreSQL to return dates from selects at this format: "dd/mm/yyyy",
> but it insists in returning it as "yyyy-mm-dd". I say "insists" cause I had
> already set datestyle to "European" (in postgresql.conf) which represents
> the format I want... I checked it executing: "SHOW DATESTYLE" and I got:
> DateStyle
> -----------
> ISO with European conventions
>
> When inserting dates, PostgreSQL understands very well my date format like
> "dd/mm/yyyy", but it is also important to get the date like that.
> I think it's possible, but I had tried all the tricks I knew or I could
> retrieve from manual...

This may be a dup (it arrived in my inbox on 11 Dec 2003), but I'll reply
just in case.

What flavor of Postgresql are you running? I'll assume 7.4.

I'm assuming you've read this section of the docs:

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

Have you tried entering:

set DateStyle='SQL, dmy';

ISO style makes it the yyyy-mm-dd format, SQL makes it the other.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-12-16 14:47:54 Re: FW: database failure..
Previous Message B. van Ouwerkerk 2003-12-16 14:34:39 Re: Any commercial shopping cart packages using