Home > Archive > PHP with PostgreSQL > June 2005 > formating dates









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author formating dates
Ângelo Marcos Rigo

2005-06-14, 8:25 pm

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

using just postgresql functions?

thank´s in advance


Ângelo Marcos Rigo
AMR Informática
(51) 3348 0870
Rua Pe. Alois Kades 400/210
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@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

Philip Hallstrom

2005-06-14, 8:25 pm

> 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/...formatting.html

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Steve Crawford

2005-06-14, 8:25 pm

On Tuesday 14 June 2005 12:44 pm, Ângelo 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@postgresql
.org

Bruno Wolff III

2005-06-14, 8:25 pm

On Tue, Jun 14, 2005 at 16:44:25 -0300,
Ângelo Marcos Rigo <angelo_rigo@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/...formatting.html

Note that dates aren't actually stored as aaa-mm-dd internally.
You might want something like:
area=> 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

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com