pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ralph.holz@gmail.com
To: pgsql-docs@postgresql.org
Subject: Requesting clarifying details on extract(epoch from timestamp)
Date: Fri, 18 Aug 2017 06:05:06 +0000
Message-ID: <20170818060506.27369.84309@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/functions-datetime.html
Description:

Hi everyone,

I would like to request a clarifying statement in the docs:

https://www.postgresql.org/account/comments/new/9.6/functions-datetime.html/

Specifically, for the case of &#39;extract epoch&#39;, the docs state:

&quot;for date and timestamp values, the number of seconds since 1970-01-01
00:00:00 local time&quot;

I ran an experiment, importing a timestamp &#39;2016-06-26 20:01:38&#39; with
default time zone &#39;localtime&#39;, which is AEST in my case.

SELECT id, extract(epoch FROM not_before) FROM bla;
-&gt; 1466971298

Now I switch to timezone = &#39;UTC&#39; in postgresql.conf. Confirming with SHOW
TIMEZONE that I am now in the default UTC timezone in my session. Same
query:
-&gt; 1466971298

In other words, it seems that the function extract(epoch from timestamp)
considered the timestamp field to be in UTC in both cases. I find it hard to
reconcile that with the docs.

Am I misreading something or is that something that should be fixed in the
docs?

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


view thread (2+ messages)  latest in thread

Message-ID: <20170818060506.27369.84309@wrigleys.postgresql.org>
Permalink:  ../20170818060506.27369.84309@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170818060506.27369.84309@wrigleys.postgresql.org

 · 

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: pgsql-docs@postgresql.org
  Cc: ralph.holz@gmail.com
  Subject: Re: Requesting clarifying details on extract(epoch from timestamp)
  In-Reply-To: <20170818060506.27369.84309@wrigleys.postgresql.org>

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

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