Skip to content

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

Closed

Description

@mattsu2020

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions