From: Bruce Momjian <bruce@momjian.us>
To: Erik Wienhold <ewie@ewie.name>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: juha.mustonen@iki.fi
Cc: pgsql-docs@postgresql.org
Subject: Re: [DOCS] Add example about date ISO format
Date: Wed, 22 Nov 2023 11:58:38 -0500
Message-ID: <ZV4zPkxh63PDTquu@momjian.us> (raw)
In-Reply-To: <ijnhw7ykfvzllqtqgwwm5vboz4ovfaxwxk3xhmgpzc62nbth6a@wvqdpbjzjxly>
References: <20170217160154.6101.52806@wrigleys.postgresql.org>
<ZV2Eo8P4q_2_F1Qe@momjian.us>
<39ac320937098e42241b947ec1165ae2003bc478.camel@cybertec.at>
<ijnhw7ykfvzllqtqgwwm5vboz4ovfaxwxk3xhmgpzc62nbth6a@wvqdpbjzjxly>
On Wed, Nov 22, 2023 at 02:02:02PM +0100, Erik Wienhold wrote:
> > > + <listitem>
> > > + <para>
> > > + <literal>to_char(current_timestamp AT TIME ZONE 'UTC',
> > > + 'YYYY-MM-DD"T"HH24:MI:SSZ')</literal> outputs the current UTC
>
> This might be excessive, but should we have an example with other time
> zones? ISO 8601 is not limited to UTC. For example:
> YYYY-MM-DD"T"HH24:MI:SSOF or YYYY-MM-DD"T"HH24:MI:SSTZH:TZM
>
> Fractional seconds are also possible: YYYY-MM-DD"T"HH24:MI:SS,FF6
Uh, I think the goal was to show how to output ISO 8601 output with "T".
I assume they can figure out how to customize that.
> > > + date/time in <acronym>ISO</acronym> 8601 date/time format.
> > > + </para>
> > > + </listitem>
> > > +
> > > </itemizedlist>
> > > </para>
> > >
> >
> > +1 on the idea, but from the context it looks like you added that example
> > at the regular expression matching functions.
> >
> > I think the example had best be at "8.5.2. Date/Time Output", in
> > doc/src/sgml/datatype.sgml around line 2552.
>
> +1 for moving it to section 8.5.2.
Okay, I moved it into the "Note" section that talked about ISO 8601
output with "T", in the attached patch.
I will apply this only to master since it is not a correction.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Only you can decide what is important to you.
Attachments:
[text/x-diff] iso.diff (825B, ../ZV4zPkxh63PDTquu@momjian.us/2-iso.diff)
download | inline diff:diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgmlindex e4a7b07033..4943f63871 100644--- a/doc/src/sgml/datatype.sgml+++ b/doc/src/sgml/datatype.sgml@@ -2472,7 +2472,11 @@ TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'
input, but on output it uses a space rather than <literal>T</literal>, as shown
above. This is for readability and for consistency with
<ulink url="https://tools.ietf.org/html/rfc3339">RFC 3339</ulink> as
- well as some other database systems.+ well as some other database systems. The function call+ <literal>to_char(current_timestamp AT TIME ZONE 'UTC',+ 'YYYY-MM-DD"T"HH24:MI:SSZ')</literal> outputs the current+ UTC date/time in <acronym>ISO</acronym> 8601 format with+ <literal>T</literal>.
</para>
</note>
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: bruce@momjian.us, ewie@ewie.name, laurenz.albe@cybertec.at, juha.mustonen@iki.fi
Subject: Re: [DOCS] Add example about date ISO format
In-Reply-To: <ZV4zPkxh63PDTquu@momjian.us>
* 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