pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedPlease add example
2+ messages / 2 participants
[nested] [flat]
* Please add example
@ 2019-09-05 15:58 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2019-09-05 15:58 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: lancetcampbell@gmail.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/functions-formatting.html
Description:
On this screen:
https://www.postgresql.org/docs/11/functions-formatting.html
Please consider adding this as an example:
to_char( (now()-INTERVAL '10 minutes') AT TIME ZONE
'UTC','YYYY-MM-DD"T"HH24:MI')
Output: 2019-09-05T15:43
Why:
This will demonstrate not only formatting but how to deal with converting
your local timestamp to other timestamps and how to get times relative to
the current time. This is extremely helpful as a way to deal with so many
external system that need UTC time zones like AWS while your database uses
local time zones.
This example would have totally changed how I would have dealt with many
issues in my software. But since the example did not exist I had no idea I
could have went down this path.
Thanks,
Lance
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Please add example
@ 2019-09-27 17:13 Bruce Momjian <bruce@momjian.us>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Momjian @ 2019-09-27 17:13 UTC (permalink / raw)
To: lancetcampbell@gmail.com; pgsql-docs@lists.postgresql.org
On Thu, Sep 5, 2019 at 03:58:22PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/11/functions-formatting.html
> Description:
>
> On this screen:
> https://www.postgresql.org/docs/11/functions-formatting.html
>
> Please consider adding this as an example:
> to_char( (now()-INTERVAL '10 minutes') AT TIME ZONE
> 'UTC','YYYY-MM-DD"T"HH24:MI')
>
> Output: 2019-09-05T15:43
>
> Why:
> This will demonstrate not only formatting but how to deal with converting
> your local timestamp to other timestamps and how to get times relative to
> the current time. This is extremely helpful as a way to deal with so many
> external system that need UTC time zones like AWS while your database uses
> local time zones.
>
> This example would have totally changed how I would have dealt with many
> issues in my software. But since the example did not exist I had no idea I
> could have went down this path.
I did improve the AT TIME ZONE docs in 2018:
commit dd6073f22a
Author: Bruce Momjian <bruce@momjian.us>
Date: Tue Sep 4 22:34:07 2018 -0400
docs: improve AT TIME ZONE description
The previous description was unclear. Also add a third example, change
use of time zone acronyms to more verbose descriptions, and add a
mention that using 'time' with AT TIME ZONE uses the current time zone
rules.
Backpatch-through: 9.3
and you can see the results here:
https://www.postgresql.org/docs/11/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT
I am not sure it helps to try to show AT TIME ZONE behavior in the
to_char docs.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-09-27 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 15:58 Please add example PG Doc comments form <noreply@postgresql.org>
2019-09-27 17:13 ` Bruce Momjian <bruce@momjian.us>
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