X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C7222D1B4F6 for ; Wed, 10 Sep 2003 16:09:04 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 05575-10 for ; Wed, 10 Sep 2003 13:08:53 -0300 (ADT) Received: from hosting.commandprompt.com (216.commandprompt.com [207.173.200.216]) by svr1.postgresql.org (Postfix) with ESMTP id F09DCD1B9CB for ; Wed, 10 Sep 2003 11:32:48 -0300 (ADT) Received: from commandprompt.com (dsl093-077-251.sea2.dsl.speakeasy.net [66.93.77.251]) (authenticated) by hosting.commandprompt.com (8.11.6/8.11.6) with ESMTP id h8AEWnE09602; Wed, 10 Sep 2003 07:32:50 -0700 Message-ID: <3F5F3610.60408@commandprompt.com> Date: Wed, 10 Sep 2003 07:32:48 -0700 From: Robby Russell Organization: Command Prompt, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Grant Henderson Cc: pgsql-php@postgresql.org Subject: Re: Date question References: <31EA81C61A3D014F8D6933864F32C60413C8A2@server1.fusion-advertising.co.uk> In-Reply-To: <31EA81C61A3D014F8D6933864F32C60413C8A2@server1.fusion-advertising.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/25 X-Sequence-Number: 2302 Grant Henderson wrote: > How do I convert a postrgesql timestamp > To an english date > > E.g. > $order_date = "2003-09-10 09:40:30+01"; > $date = date("d/M/Y", $order_date); > print($date); > Why not just do it in the database before you get to the PHP? =# SELECT to_char(now(), 'Month-fmdd-yyyy'::text); to_char ------------------- September-10-2003 (1 row) More info: http://www.postgresql.org/docs/7/interactive/functions2976.htm Hope that can help, -Robby -- Robby Russell, | Sr. Administrator / Lead Programmer Command Prompt, Inc. | http://www.commandprompt.com rrussell@commandprompt.com | Telephone: (503) 222.2783