Re: [SQL] parts of date_part()

From: Leslie Mikesell <les(at)Mcs(dot)Net>
To: herouth(at)oumail(dot)openu(dot)ac(dot)il (Herouth Maoz)
Cc: ericm(at)palaver(dot)net, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] parts of date_part()
Date: 1998-08-26 16:53:39
Message-ID: 199808261653.LAA18509@Venus.mcs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

According to Herouth Maoz:
>
> 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.

Is there any documentation (or is any needed) for the equivalent functions
mapped to their SQL92 "extract (field from value)" syntax?

Since I just ran across:
psql=> select date_part('month','01-01-1998'::date);
date_part
---------
12
(1 row)
and the extract() does the same in this case, I'm being a little cautious...

Les Mikesell
les(at)mcs(dot)com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ian Johnston 1998-08-26 20:15:06 How do I ???
Previous Message Leslie Mikesell 1998-08-26 15:15:44 Re: [SQL] excel vs. money data type?