From: Gary Hoffman <ghoffman@ucsd.edu>
To: pgsql-php@postgresql.org <pgsql-php@postgresql.org>
Cc: enzovenegas@mixmail.com
Subject: Re: format query
Date: Thu, 17 Mar 2005 10:30:38 -0800
Message-ID: <fc.00249f0e0138847d3b9aca00c0805dc7.1388627@irpsmail.ucsd.edu> (raw)
In-Reply-To: <E1DBvrX-0006AB-00@relay.mixmail.com>
References: <E1DBvrX-0006AB-00@relay.mixmail.com>
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/ *
**************************************************************************
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: ghoffman@ucsd.edu, enzovenegas@mixmail.com
Subject: Re: format query
In-Reply-To: <fc.00249f0e0138847d3b9aca00c0805dc7.1388627@irpsmail.ucsd.edu>
References: <E1DBvrX-0006AB-00@relay.mixmail.com> <fc.00249f0e0138847d3b9aca00c0805dc7.1388627@irpsmail.ucsd.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox