Hi Benson, Benson Muite <[email protected]> writes:
> The date function has an option to output dates in rfc3339 format. A > successor to this format is rfc9557[0]. RFC 9557 adds additional > options to use information from tzdata in the output, in particular > dates of the form: > > 2006-08-14T02:34:56-06:00[America/Guatemala] > > Would there be willingness to consider a patch that adds this > functionality? In additon to changes in date.c changes would be needed > in GNUlib as this provides the main functionality and allows for > portability through strftime.c can contribute necessary changes to > GNULib as well. > > There has been a little related discussion at: > https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00007.html > > GNU/Linux systems using systemd provide timezone information in the > form [Region/City], through timedatectl but this is not in rfc9557 > form. One may want this functionality on other systems, for example > using OpenRC, so having it in the date command would be desirable. > > Benson > > [0] https://datatracker.ietf.org/doc/html/rfc9557 Thanks for the detailed message and offering to implement this. The main question that I have is how would you pick a time zone name given the UTC offset? For example, I am from California so I use Pacific Time: $ date --iso-8601=minutes 2026-03-16T11:06-07:00 If we were to implement 'date --rfc-9557', how would you chose between the following outputs? $ date --rfc-9557=minutes 2026-03-16T11:06-07:00[America/Los_Angeles] $ date --rfc-9557=minutes 2026-03-16T11:06-07:00[America/Tijuana] Collin
