formating dates

Поиск
Список
Период
Сортировка
Искать

formating dates

От:
Ângelo Marcos Rigo <angelo_rigo@yahoo.com.br>
Дата:
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/ 

Re: formating dates

От:
Philip Hallstrom <postgresql@philip.pjkh.com>
Дата:
> 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-formatting.html

Re: formating dates

От:
Steve Crawford <scrawford@pinpointresearch.com>
Дата:
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

Re: formating dates

От:
Bruno Wolff III <bruno@wolff.to>
Дата:
On Tue, Jun 14, 2005 at 16:44:25 -0300,
  Â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?

You can use the to_char function. See:
http://www.postgresql.org/docs/8.0/static/functions-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)
FAQ