| From: | "Raymond O'Donnell" <rod(at)iol(dot)ie> |
|---|---|
| To: | "Pgsql-General" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Problem working with dates and times. |
| Date: | 2006-12-04 22:40:28 |
| Message-ID: | 4574A3DC.13748.CF8C14@rod.iol.ie |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On 4 Dec 2006 at 20:13, Alejandro Michelin Salomon ( Adinet ) wrote:
> But i only need 2006-12-05 from the resulting timestamp.
> How to cut only the date from this timestamp?
Use date_trunc() just to lop off the time part of the timestamp:
http://www.postgresql.org/docs/8.2/static/functions-
datetime.html#FUNCTIONS-DATETIME-TRUNC
Alternatively, use to_char() to format the output exactly as you'd
like it:
http://www.postgresql.org/docs/8.2/static/functions-formatting.html
--Ray.
----------------------------------------------------------------------
Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod(at)iol(dot)ie
----------------------------------------------------------------------
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Glaesemann | 2006-12-04 22:44:19 | Re: Problem working with dates and times. |
| Previous Message | Brandon Aiken | 2006-12-04 21:41:58 | Re: n00b RAID + wal hot standby question |