X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 8080C310901 for ; Tue, 1 Jul 2003 01:48:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 30605-07 for ; Mon, 30 Jun 2003 22:48:16 -0300 (ADT) Received: from seapdc01.PNTS (ip63.c216.blk1.bel.nwlink.com [209.20.216.63]) by svr1.postgresql.org (Postfix) with ESMTP id 9CB31310815 for ; Mon, 30 Jun 2003 22:48:15 -0300 (ADT) Received: from busbydev (BUSBY-DEV [10.0.0.17]) by seapdc01.PNTS with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id N2LV1FJ5; Mon, 30 Jun 2003 19:03:16 -0700 Message-ID: <04d601c33f72$0216b4d0$1100000a@busbydev> Reply-To: "David Busby" From: "David Busby" To: "Michael Hanna" Cc: References: <20099B92-AB62-11D7-A8B3-00039308EB2C@hwcn.org> Subject: Re: Best way to convert PG's TIMESTAMPTZ to PHP DATE? Date: Mon, 30 Jun 2003 18:42:05 -0700 Organization: Pacific Northwest Ticket Service MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Archive-Number: 200306/46 X-Sequence-Number: 2110 Hmmm, Sometimes that happens to me too, I cannot seem to isolate what causes it however. When I get that I use the PG to_char function in my statement to convert the value to something I can use in PHP. I wish I could provide more information about why this is hit and miss. /B ----- Original Message ----- From: "Michael Hanna" To: "David Busby" Cc: Sent: Monday, June 30, 2003 18:19 Subject: Re: [PHP] Best way to convert PG's TIMESTAMPTZ to PHP DATE? for some reason I get: Wed, 31 Dec 1969 18:59:59 -0500 as output on any entry. ----- $rows = pg_num_rows($result); // if records present if ($rows > 0) { // iterate through resultset for ($i=0; $i<$rows; $i++) { $row = pg_fetch_object($result, $i); $conv_date = date('r',strtotime($row->posted)); ?>

  • notes; ?>

    Both of these work OK for me > > date('r',strtotime($record->date_field)); >