#14976·coreutils

stat: incorrect rounding of fractional pre-epoch timestamps with precision

Author: mattsu2020Created Sep 30, 2026Updated Sep 30, 2026
LabelsB - high priorityU - statgnu testsuite

Description

stat produces incorrect output for fractional timestamps before the Unix epoch when precision is specified.

For example:

-0.876543211

%.1Y -> -0.9
%.3Y -> -0.877

GNU coreutils produces:

%.1Y -> -0.8
%.3Y -> -0.876

The fractional value should be truncated toward zero when reducing precision.

Related: #14705