Re: T is a mandatory date time separator in RFC3339 but documentation states differently

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Roman Frołow <rofrol(at)gmail(dot)com>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: T is a mandatory date time separator in RFC3339 but documentation states differently
Date: 2023-11-13 14:24:33
Message-ID: piavtdd7mhmkpzpgvxaek3hz3e2kan3c2fitn5iqta6nyrpgyl@txongxshxkxw
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 2023-11-13 12:27 +0100, Roman Frołow wrote:
> It seems I was wrong.
> Now T is mandatory in ISO8601 and from RFC3339 it seems this requirement is
> relaxed.

Right. RFC 3339 is from 2002 and it references ISO 8601:1988 where T
was optional. (Until today I didn't even know about the 2019 edition.)
RFC 3339 made the separator mandatory and also permitted any character.

Also SQL only uses part of ISO 8601 (without specifying a particular
edition), namely the definition of UTC and date according to 3.1.4 in
Part 2 of the standard:

> 3.1.4 Definitions taken from ISO 8601
>
> For the purposes of this part of ISO/IEC 9075, the definitions of the
> following terms given in ISO 8601 apply:
>
> 3.1.4.1 Coordinated Universal Time (UTC)
> 3.1.4.2 date (date, calendar in ISO 8601)

I think the docs should clarify that "ISO 8601" in this case refers to a
subset of definitions as layed out in the SQL standard. For example,
week date (SELECT '2023-W46-1'::date) is not accepted by Postgres, but
ordinal date (SELECT '2023-317'::date) is.

I also noticed that when people say "ISO 8601" they usually mean RFC
3389 or some subset of ISO 8601. [1]

[1] https://robinpokorny.com/blog/why-developers-should-stop-using-iso-8601-for-date-time/

--
Erik

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Erik Wienhold 2023-11-13 14:29:35 Re: T is a mandatory date time separator in RFC3339 but documentation states differently
Previous Message Daniel Gustafsson 2023-11-13 12:38:57 Re: add new acronym "AM"