|
|
 | | From: | Troels Arvin | | Subject: | Week numbering | | Date: | Mon, 06 Dec 2004 11:22:37 +0100 |
|
|
 | --=-0F3bTVuyUU4K60QTCKod Content-Type: text/plain Content-Transfer-Encoding: 7bit
Hello,
I was recently surprised to find that EXTRACT's day of the week numbering is different than TO_CHAR's ditto. EXTRACT starts at 0==Sunday while TO_CHAR starts at 1==Sunday.
A suggestion for two documentation notes is attached as a patch to current CVS HEAD.
-- Greetings from Troels Arvin, Copenhagen, Denmark
--=-0F3bTVuyUU4K60QTCKod Content-Disposition: attachment; filename=pgsql-day-of-week-docs.patch Content-Type: text/x-patch; name=pgsql-day-of-week-docs.patch; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit
Index: doc/src/sgml/func.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.229 diff -c -r1.229 func.sgml *** doc/src/sgml/func.sgml 3 Dec 2004 18:34:31 -0000 1.229 --- doc/src/sgml/func.sgml 6 Dec 2004 10:16:57 -0000 *************** *** 4412,4417 **** --- 4412,4424 ---- 1230 microseconds = 2.021230 seconds. + + + to_char's day of the week numbering + (see the 'D' formatting pattern) is different from that of the + extract function. + + *************** *** 5146,5151 **** --- 5153,5163 ---- SELECT EXTRACT(DOW FROM TIMESTAMP '2001-02-16 20:38:40'); Result: 5 + + Note that extract's day of the week numbering is + different from that of the to_char function. + +
--=-0F3bTVuyUU4K60QTCKod Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0
---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings
--=-0F3bTVuyUU4K60QTCKod--
|
|
 | | From: | Bruce Momjian | | Subject: | Re: Week numbering | | Date: | Mon, 20 Dec 2004 20:02:51 -0500 (EST) |
|
|
 | Patch applied. Thanks.
---------------------------------------------------------------------------
Troels Arvin wrote: > Hello, > > I was recently surprised to find that EXTRACT's day of the week > numbering is different than TO_CHAR's ditto. EXTRACT starts at 0==Sunday > while TO_CHAR starts at 1==Sunday. > > A suggestion for two documentation notes is attached as a patch to > current CVS HEAD. > > -- > Greetings from Troels Arvin, Copenhagen, Denmark
[ Attachment, skipping... ]
> > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster
|
|
|