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.877GNU coreutils produces:
%.1Y -> -0.8
%.3Y -> -0.876The fractional value should be truncated toward zero when reducing precision.
Related: #14705
Source: uutils/coreutils