Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.8.8/8.7.5) with ESMTP id EAA05788 for ; Wed, 26 Aug 1998 04:56:22 -0400 (EDT) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.5/8.8.5) with ESMTP id LAA06048; Wed, 26 Aug 1998 11:56:01 +0300 (IDT) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 26 Aug 1998 11:57:16 +0300 To: Eric McKeown , PGsql From: Herouth Maoz Subject: Re: [SQL] parts of date_part() At 2:33 +0300 on 25/8/98, Eric McKeown wrote: > > Well, I've done some digging in the FAQ, the user documentation, and the > man pages, so I hope nobody screams 'RTFM' on this question, but I suppose > you're welcome to if it was somewhere obvious and I missed it. > > I'm looking for a complete list of the different "date parts" that I can > use to extract information about a given datetime value in a table. Actually, it is an RTFM... From the manpage of pgbuiltin (my postgres version is 6.2.1): For the date_part() and date_trunc() functions, arguments can be `year', `month', `day', `hour', `minute', and `second', as well as the more specialized quantities `decade', `century', `millenium', `millisecond', and `microsecond'. date_part() allows `dow' to return day of week and `epoch' to return seconds since 1970 for datetime and 'epoch' to return total elapsed seconds for timespan. So... Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma