public inbox for [email protected]  
help / color / mirror / Atom feed
From: Reid Thompson <[email protected]>
To: [email protected] <[email protected]>
Cc: Reid Thompson <[email protected]>
Subject: Re: FW: [webmaster] Possible error in documentation for EXTRACT
Date: Wed, 6 Apr 2016 20:06:26 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-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
> [email protected]

$ 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.
-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: FW: [webmaster] Possible error in documentation for EXTRACT
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox