Skip site navigation (1) Skip section navigation (2)

Re: formating dates

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Ângelo Marcos Rigo <angelo_rigo(at)yahoo(dot)com(dot)br>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: formating dates
Date: 2005-06-14 20:31:28
Message-ID: 20050614203128.GB19923@wolff.to (view raw or flat)
Thread:
Lists: pgsql-php
On Tue, Jun 14, 2005 at 16:44:25 -0300,
  Ângelo Marcos Rigo <angelo_rigo(at)yahoo(dot)com(dot)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-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)

In response to

pgsql-php by date

Next:From: enzo venegas palaciosDate: 2005-06-14 22:34:44
Subject: pg_dump
Previous:From: Steve CrawfordDate: 2005-06-14 19:58:17
Subject: Re: formating dates

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group