public inbox for [email protected]  
help / color / mirror / Atom feed
From: Mark Clark <[email protected]>
To: [email protected] <[email protected]>
Subject: FW: [webmaster] Possible error in documentation for EXTRACT
Date: Wed, 6 Apr 2016 17:05:40 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>

TWIMC,
           In the documentation for EXTRACT<http://www.postgresql.org/docs/9.5/interactive/functions-datetime.html#FUNCTIONS-DATETIME-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]



view thread (2+ messages)  latest in thread

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