Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
Re: strftime.3: clarify %G and %g description
To:
Theo Buehler <tb@theobuehler.org>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, tech@openbsd.org, Ingo Schwarze <schwarze@openbsd.org>, Lucas Gabriel Vuotto <lucas@sexy.is>
Date:
Wed, 24 Apr 2024 08:29:53 -0600

Download raw body.

Thread
On Wed, 24 Apr 2024 11:21:17 +0200, Theo Buehler wrote:

> There's also a long description in the STANDARDS section. Maybe it's
> enough to say 'See the description of %V and the STANDARDS section for
> details.' in %g and %G rather than adding a third variant of the
> necessarily confusing explanation.

How about this?  Some of the wording is from the upstream version.

 - todd

Index: strftime.3
===================================================================
RCS file: /cvs/src/lib/libc/time/strftime.3,v
diff -u -p -u -r1.38 strftime.3
--- strftime.3	16 May 2019 13:35:17 -0000	1.38
+++ strftime.3	24 Apr 2024 14:29:06 -0000
@@ -111,10 +111,20 @@ is replaced by the date in the format
 is replaced by the
 .St -iso8601
 year with century as a decimal number.
+See also the
+.Cm \&%V
+conversion specification and the
+.Sx STANDARDS
+section for more details.
 .It Cm \&%g
 is replaced by the
 .St -iso8601
 year without century as a decimal number (00\-99).
+See also the
+.Cm \&%V
+conversion specification and the
+.Sx STANDARDS
+section for more details.
 .It Cm \&%H
 is replaced by the hour (24-hour clock) as a decimal number (00\-23).
 .It Cm \&%I
@@ -169,6 +179,12 @@ the week) as a decimal number (01\-53).
 If the week containing January
 1 has four or more days in the new year, then it is week 1; otherwise
 it is week 53 of the previous year, and the next week is week 1.
+The year is given by the
+.Cm \&%G
+conversion specification.
+See the
+.Sx STANDARDS
+section for more details.
 .It Cm \&%v
 is replaced by the date in the format
 .Dq Li "%e-%b-%Y" .