X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2B151528E7 for ; Tue, 14 Jun 2005 17:32:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79535-01 for ; Tue, 14 Jun 2005 20:31:57 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id 0B1BE528D0 for ; Tue, 14 Jun 2005 17:31:56 -0300 (ADT) Received: (qmail 23543 invoked by uid 500); 14 Jun 2005 20:31:28 -0000 Date: Tue, 14 Jun 2005 15:31:28 -0500 From: Bruno Wolff III To: =?iso-8859-1?Q?=C2ngelo?= Marcos Rigo Cc: pgsql-php@postgresql.org Subject: Re: formating dates Message-ID: <20050614203128.GB19923@wolff.to> Mail-Followup-To: Bruno Wolff III , =?iso-8859-1?Q?=C2ngelo?= Marcos Rigo , pgsql-php@postgresql.org References: <20050614194425.18990.qmail@web33707.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050614194425.18990.qmail@web33707.mail.mud.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/5 X-Sequence-Number: 3164 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)