HomeFreeBSD

date: Improve nanosecond support

Description

date: Improve nanosecond support

Add support for a field width, which defaults to 9 if unspecified or
zero. If the width is not exactly 9, we have to either cut off digits
or append zeroes to make up the difference. If the width is a dash,
we pick a width based on the clock's reported resolution. This brings
us in line with GNU coreutils.

PR: 287080
MFC after: 1 week
Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D53667

(cherry picked from commit 38839c872e7af6a1424009bf07d6b4450e9ca61d)

Details

Provenance
desAuthored on Nov 11 2025, 2:58 PM
Reviewer
0mp
Differential Revision
D53667: date: Improve nanosecond support
Parents
rGc00ad4a56c78: pci.9: Fix a typo in the manual page
Branches
Unknown
Tags
Unknown