Re: output format for dates

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: am(at)fx(dot)ro
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: output format for dates
Date: 2002-09-22 16:04:32
Message-ID: Pine.LNX.4.44.0209221203270.2000-100000@cm-lcon1-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am(at)fx(dot)ro dijo:

Hi,

> I would like to use the following format for dates:
> DD-MON-YYYY or DD-MON-YY, where MON is one of : JAN,FEB,..,DEC.
> (for example 20-APR-2002) for both input and output.

You can use to_char(),

regression=# select (to_char('20-04-2002'::date, 'dd-MON-yyyy'));
to_char
-------------
20-APR-2002
(1 row)

regression=#

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Y eso te lo doy firmado con mis lagrimas" (Fiebre del loco)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-09-23 01:51:55 Re: Monitoring a Query
Previous Message Justin Clift 2002-09-22 15:55:06 Re: New PostgreSQL Tool available : pg_autotune