formating dates

Hi can i format dates from postgresql stored in the
aaa-mm-dd format to June 14 2005 - Tuesday ?

using just postgresql functions?

thank=B4s in advance


=C2ngelo Marcos Rigo
AMR Inform=E1tica
(51) 3348 0870
Rua Pe. Alois Kades 400/210
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo [at] yahoo.com.br



__________________________________________________
Converse com seus amigos em tempo real com o Yahoo! Messenger
http://br.download.yahoo.com/messenger/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq
angelo_rigo [ Di, 14 Juni 2005 21:44 ] [ ID #836646 ]

Re: formating dates

> Hi can i format dates from postgresql stored in the
> aaa-mm-dd format to June 14 2005 - Tuesday ?
>
> using just postgresql functions?

Yes.

http://www.postgresql.org/docs/7.4/interactive/functions-for matting.html

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Philip Hallstrom [ Di, 14 Juni 2005 21:52 ] [ ID #836647 ]

Re: formating dates

On Tuesday 14 June 2005 12:44 pm, =C2ngelo Marcos Rigo wrote:
> Hi can i format dates from postgresql stored in the
> aaa-mm-dd format to June 14 2005 - Tuesday ?
>
> using just postgresql functions?

select to_char(now(), 'FMMonth dd yyyy - FMDay');

See to_char() documentation for more.

Cheers,
Steve


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo [at] postgresql.org
Steve Crawford [ Di, 14 Juni 2005 21:58 ] [ ID #836648 ]

Re: formating dates

On Tue, Jun 14, 2005 at 16:44:25 -0300,
=C2ngelo Marcos Rigo <angelo_rigo [at] yahoo.com.br> wrote:
> Hi can i format dates from postgresql stored in the
> aaa-mm-dd format to June 14 2005 - Tuesday ?
>
> using just postgresql functions?

You can use the to_char function. See:
http://www.postgresql.org/docs/8.0/static/functions-formatti ng.html

Note that dates aren't actually stored as aaa-mm-dd internally.
You might want something like:
area=3D> select to_char(current_date, 'Month DD YYYY Day');
to_char
-----------------------------
June 14 2005 Tuesday
(1 row)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Bruno Wolff III [ Di, 14 Juni 2005 22:31 ] [ ID #836649 ]
Datenbanken » gmane.comp.db.postgresql.php » formating dates

Vorheriges Thema: FW: How to store binaries and ASCII files in DB
Nächstes Thema: postgresql por ports o fuentes en freebsd