Skip to content

printf %T is severely broken, breaks compatibility #915

@jelmd

Description

@jelmd

Somewhere "printf %T" handling seems to got broken in a incompatible way. Discovered when upgrading to Ubuntu 24.04 which ships ksh Version AJM 93u+m/1.0.8 2024-01-01. The version shipped with the previous release, Ubuntu 22.04, seems to be ok (ksh Version AJM 93u+m/1.0.0-beta.2 2021-12-17).

E.g. the output of ksh93 -c 'LC_TIME=C printf "%(%Y-%m-%d)T\n" "now in 10 weeks"' (right now the same as ksh93 -c 'LC_TIME=C printf "%(%Y-%m-%d)T\n" "2025-11-10 in 10 weeks"'):

Expected: 2026-01-19
Got: 2025-11-10

Similar broken behavior wrt. to [abbrev.] name of the day of the week, and month of the year. E.g.:

ksh93 -c 'LC_TIME=de_DE.UTF-8 printf "%T\n" 2025-11-10'

Expected: Mo 10. Nov 00:43:42 CET 2025
Got: 10 00:44:41 MET 2025

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions