Hi,
The find(1) manual entry's and info entry's
descriptions of -printf's %Ac %t %a %c are inaccurate.
Attached is a patch to make them accurate.
Here's what it says for %Ac:
locale's date and time (Sat Nov 04 12:02:33 EST 1989).
The format is the same as for ctime(3) and so to preserve
compatibility with that format, there is no fractional
part in the seconds field.
The locale's preferred date and time format is not the same
as for ctime(3). ctime(3) is deliberately locale-independent.
So the two sentences are mutually contradictory. And the reason
that there is no fractional part in the seconds field is not
to preserve compatibility with the ctime format. It is just
that no locale's preferred date and time format includes
nanoseconds. The ctime format also includes a newline which
the locale's preferred format never does.
The equivalent text in file.texi is inaccurate in the same way,
but the text isn't exactly the same.
My suggestion for replacement text is:
locale's preferred date and time (e.g. Sat Nov 04 12:02:33 EST
1989). This format does not include any fractional part in the
seconds field.
I included the word "preferred" because that's how the strftime(3)
manual entry describes its %c format conversion:
"The preferred date and time representation for the current locale."
Here's what find's man/info says for %c:
File's last status change time in the format returned
by the C ctime(3) function.
This is incorrect. The ctime(3) format does not include
nanoseconds/fractional part. The %c format conversion does.
The ctime(3) format includes a newline. The %c format conversion
doesn't.
My suggestion for replacement text is:
File's last status change time in the format returned
by the C ctime(3) function but with a fractional part
in the seconds field and without a newline.
The descriptions of %t and %a have the same inaccuracy.
Here's what the formats look like in different locales on GNU/Linux:
> LANG=C find /etc/hosts -printf '%t\n%a\n%c\n%Tc\n%Ac\n%Cc\n'
Mon Dec 9 00:47:21.2759450200 2024
Thu Nov 19 10:22:36.0055919070 2026
Mon Dec 9 00:47:21.2799449190 2024
Mon Dec 9 00:47:21 2024
Thu Nov 19 10:22:36 2026
Mon Dec 9 00:47:21 2024
> LANG=fr_FR.UTF-8 find /etc/hosts -printf '%t\n%a\n%c\n%Tc\n%Ac\n%Cc\n'
Mon Dec 9 00:47:21.2759450200 2024
Thu Nov 19 10:22:36.0055919070 2026
Mon Dec 9 00:47:21.2799449190 2024
lun. 09 déc. 2024 00:47:21
jeu. 19 nov. 2026 10:22:36
lun. 09 déc. 2024 00:47:21
> LANG=en_US.UTF-8 find /etc/hosts -printf '%t\n%a\n%c\n%Tc\n%Ac\n%Cc\n'
Mon Dec 9 00:47:21.2759450200 2024
Thu Nov 19 10:22:36.0055919070 2026
Mon Dec 9 00:47:21.2799449190 2024
Mon 09 Dec 2024 12:47:21 AM AEDT
Thu 19 Nov 2026 10:22:36 AM AEDT
Mon 09 Dec 2024 12:47:21 AM AEDT
cheers,
raf
diff --git a/doc/find.texi b/doc/find.texi
index 15c8e224..8a0a9b48 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -2209,7 +2209,8 @@ Wed Nov 2 00:42:36 1994
@table @code
@item %a
File's last access time in the format returned by the C @code{ctime}
-function.
+function but with a fractional part in the seconds field
+and without a newline.
@item %A@var{k}
File's last access time in the format specified by @var{k}
@@ -2224,7 +2225,8 @@ filesystem does not support birth times.
@item %c
File's last status change time in the format returned by the C
-@code{ctime} function.
+@code{ctime} function but with a fractional part in the seconds field
+and without a newline.
@item %C@var{k}
File's last status change time in the format specified by @var{k}
@@ -2232,7 +2234,8 @@ File's last status change time in the format specified by @var{k}
@item %t
File's last modification time in the format returned by the C
-@code{ctime} function.
+@code{ctime} function but with a fractional part in the seconds field
+and without a newline.
@item %T@var{k}
File's last modification time in the format specified by @var{k}
@@ -2362,7 +2365,7 @@ time, 24-hour (hh:mm:ss.xxxxxxxxxx)
locale's time representation (H:M:S). The seconds field includes a
fractional part.
@item c
-locale's date and time in ctime format (Sat Nov 04 12:02:33 EST
+locale's preferred date and time (e.g. Sat Nov 04 12:02:33 EST
1989). This format does not include any fractional part in the
seconds field.
@item D
diff --git a/find/find.1 b/find/find.1
index 53d2217c..24f1362a 100644
--- a/find/find.1
+++ b/find/find.1
@@ -1587,7 +1587,8 @@ A literal percent sign.
.IP %a
File's last access time in the format returned by the C
.BR ctime (3)
-function.
+function but with a fractional part in the seconds field
+and without a newline.
.IP %A\fIk\fP
File's last access time in the format specified by
.IR k ,
@@ -1660,11 +1661,9 @@ locale's abbreviated month name (Jan..Dec)
.IP B
locale's full month name, variable length (January..December)
.IP c
-locale's date and time (Sat Nov 04 12:02:33 EST 1989). The format is
-the same as for
-.BR ctime (3)
-and so to preserve compatibility with that format, there is no fractional part
-in the seconds field.
+locale's preferred date and time (e.g. Sat Nov 04 12:02:33 EST
+1989). This format does not include any fractional part in the
+seconds field.
.IP d
day of month (01..31)
.IP D
@@ -1705,7 +1704,8 @@ filesystem does not support birth times.
.IP %c
File's last status change time in the format returned by the C
.BR ctime (3)
-function.
+function but with a fractional part in the seconds field
+and without a newline.
.IP %C\fIk\fP
File's last status change time in the format specified by
.IR k ,
@@ -1789,7 +1789,8 @@ a file's sparseness is assumed to be 1.0.
.IP %t
File's last modification time in the format returned by the C
.BR ctime (3)
-function.
+function but with a fractional part in the seconds fie
+and without a newline.
.IP %T\fIk\fP
File's last modification time in the format specified by
.IR k ,