Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5qYp-00FP3g-Nv for pgsql-docs@arkaria.postgresql.org; Wed, 22 Nov 2023 16:58:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r5qYo-00Axvu-9e for pgsql-docs@arkaria.postgresql.org; Wed, 22 Nov 2023 16:58:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5qYn-00AxvS-QE for pgsql-docs@lists.postgresql.org; Wed, 22 Nov 2023 16:58:46 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5qYl-007oK4-6s for pgsql-docs@postgresql.org; Wed, 22 Nov 2023 16:58:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=N2ZwmVhUSOh0/0I/DzSK9PhVHP+WfU1CAcNGt18DJ88=; b=gxhcM FxrXZlvYQei1h8w3AS1J+5IvOlAUyazxqp6qpHlG/ynwaJr4bA/YPoPzrZgEMtoB1Dnm3BQsW5NAG wybCgM/bVEYJ7zSqt80/hQ6US+xEP8xjbsMn0Aan/aHzZksfx7Sj3j8FIBoTiIYKWdSczE2oJG1TU +dOcVeL2gHUBYyKJmRWnVVkCthso0PQodE8V+usBC+Esx+6/ssFaw1ywq3KH0A4p/VZ9b5g1pikRc 0suypvxh9QlFRuIVleSIwSP7qyj09AsPeGYT3FpwGSlawOPXzAXonogJCAIEay8AMTXQEGKF71sUO eTKn8I4F7ivcQdeFS27Kg6hOaBvrA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1r5qYg-00Aje1-2T; Wed, 22 Nov 2023 11:58:38 -0500 Date: Wed, 22 Nov 2023 11:58:38 -0500 From: Bruce Momjian To: Erik Wienhold Cc: Laurenz Albe , juha.mustonen@iki.fi, pgsql-docs@postgresql.org Subject: Re: [DOCS] Add example about date ISO format Message-ID: References: <20170217160154.6101.52806@wrigleys.postgresql.org> <39ac320937098e42241b947ec1165ae2003bc478.camel@cybertec.at> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cCBYJ160y/U/wfEf" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --cCBYJ160y/U/wfEf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 22, 2023 at 02:02:02PM +0100, Erik Wienhold wrote: > > > + > > > + > > > + to_char(current_timestamp AT TIME ZONE 'UTC', > > > + 'YYYY-MM-DD"T"HH24:MI:SSZ') 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 ISO 8601 date/time format. > > > + > > > + > > > + > > > > > > > > > > > > > +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 https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --cCBYJ160y/U/wfEf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="iso.diff" diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 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 T, as shown above. This is for readability and for consistency with RFC 3339 as - well as some other database systems. + well as some other database systems. The function call + to_char(current_timestamp AT TIME ZONE 'UTC', + 'YYYY-MM-DD"T"HH24:MI:SSZ') outputs the current + UTC date/time in ISO 8601 format with + T. --cCBYJ160y/U/wfEf--