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 0C34A566EC for ; Thu, 17 Mar 2005 18:30:52 +0000 (GMT) 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 28994-06 for ; Thu, 17 Mar 2005 18:30:46 +0000 (GMT) Received: from mailbox4.ucsd.edu (mailbox4.ucsd.edu [132.239.1.56]) by svr1.postgresql.org (Postfix) with ESMTP id 0A85C54E6E for ; Thu, 17 Mar 2005 18:30:45 +0000 (GMT) Received: from irpsmail.ucsd.edu (irpsmail.ucsd.edu [132.239.21.3]) by mailbox4.ucsd.edu (8.13.1/8.13.1) with ESMTP id j2HIUeVs065921; Thu, 17 Mar 2005 10:30:40 -0800 (PST) Message-id: Date: Thu, 17 Mar 2005 10:30:38 -0800 Subject: Re: format query To: "pgsql-php@postgresql.org" Cc: enzovenegas@mixmail.com From: "Gary Hoffman" References: In-Reply-To: MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylisting: NO DELAY (Trusted relay host); processed by UCSD_GL-v1.2 on mailbox4.ucsd.edu; Thu, 17 March 2005 10:30:40 -0800 (PST) X-MailScanner: PASSED (v1.2.8 44203 j2HIUeVs065921 mailbox4.ucsd.edu) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.47 tagged_above=0 required=5 tests=TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200503/45 X-Sequence-Number: 3060 enzovenegas@mixmail.com writes: >I need to prove to be alone the date and not the hour of a table with >format >timestamp. > >please. Enzo, I've used two different methods: -The SQL string function substr(string) gets the parts of the result that you need, where the date is cast as text. -The PostgreSql SQL function epoch(timestamp) in your query gets the timestamp as a numeric that the PHP function date() can format however you want. Good luck, Gary ************************************************************************** * Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu * * Graduate School of International Relations and Pacific Studies (IR/PS) * * University of California, San Diego (UCSD) voice: (858) 534-1989 * * 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 * * La Jolla, CA 92093-0519 USA web: http://irps.ucsd.edu/ * **************************************************************************