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 807D4D1B4F9 for ; Wed, 10 Sep 2003 13:56:53 +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 65333-02 for ; Wed, 10 Sep 2003 10:56:26 -0300 (ADT) Received: from tomts7-srv.bellnexxia.net (tomts7.bellnexxia.net [209.226.175.40]) by svr1.postgresql.org (Postfix) with ESMTP id E62AFD1B51A for ; Wed, 10 Sep 2003 10:56:21 -0300 (ADT) Received: from acer.sympatico.ca ([65.93.65.25]) by tomts7-srv.bellnexxia.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030910135602.BWBW10852.tomts7-srv.bellnexxia.net@acer.sympatico.ca>; Wed, 10 Sep 2003 09:56:02 -0400 Message-Id: <5.2.1.1.0.20030910095139.00a11c60@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Wed, 10 Sep 2003 09:54:46 -0400 To: pgsql-php@postgresql.org From: Frank Bax Subject: Re: Date question Cc: "Grant Henderson" In-Reply-To: <31EA81C61A3D014F8D6933864F32C60413C8A2@server1.fusion-adve rtising.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/23 X-Sequence-Number: 2300 At 05:46 AM 9/10/03, 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); The input to php "date" function is a unix timestamp, not a string. Use: select date_part('epoch',order_date) from ... instead of select order_date from ... >---------------------------(end of broadcast)--------------------------- >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org