From: | Reid Thompson <Reid(dot)Thompson(at)ateb(dot)com> |
---|---|
To: | "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org> |
Cc: | Reid Thompson <Reid(dot)Thompson(at)ateb(dot)com> |
Subject: | Re: FW: [webmaster] Possible error in documentation for EXTRACT |
Date: | 2016-04-06 20:06:26 |
Message-ID: | 1459973147.9557.90.camel@ateb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
On Wed, 2016-04-06 at 17:05 +0000, Mark Clark wrote:
>
> TWIMC,
> In the documentation for EXTRACT, the example for “century" is as
> follows:
> SELECT EXTRACT(CENTURY FROM TIMESTAMP '2000-12-16 12:21:13');
> Result: 20
> SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40');
> Result: 21
> I believe the result for the second SELECT is incorrect. I believe it should
> be:
> SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40');
> Result: 20
> Alternatively, you could change the example to:
> SELECT EXTRACT(CENTURY FROM TIMESTAMP '2100-02-16 20:38:40');
> Result: 21
> If I have missed some point about how this should work, then please ignore
> this e-mail.
>
> Thanks,
> Mark Clark
> mark(dot)clark(at)enlightedinc(dot)com
$ psql test
Timing is on.
psql (9.5.2)
Type "help" for help.
test=# SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40');
date_part
-----------
21
(1 row)
Time: 1.336 ms
test=#
the 21st century began on 2001-01-01.
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Law | 2016-04-12 15:32:37 | Missing braces in ecpg.sgml |
Previous Message | Mark Clark | 2016-04-06 17:05:40 | FW: [webmaster] Possible error in documentation for EXTRACT |