You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] printf '%(fmt)T': %l/%k/%u strftime specs unimplemented (literal passthrough) AND the time is formatted in UTC instead of localtime (TZ ignored) #326
Unsupported (printed literally): %l (12-hour space-padded), %k (24-hour space-padded), %u (ISO day of week). Working: %a %d %b %M %p %e %V %G %H.
Reproducer B — UTC instead of localtime (target/probe-out/p12.sh)
printf'%(%H:%M)T\n' -1
printf'%(%Z)T\n' -1
GNU (WSL, TZ=CST-8): 16:22 / CST
rubash (same wall clock, Windows host is CST): 08:22 / UTC
GNU anchor
builtins/printf.def:633 (+637) tm = localtime (&secs); — bash %(fmt)T formats with localtime; the format then goes to system strftime (glibc), which owns %l/%k/%u. rubash must call the localtime conversion (Windows: localtime_s / TZ env) and extend its strftime subset table with %l/%k/%u.
Impact
pbb date section prints %l literally and the wrong half of the day; any prompt/theme script formatting time via printf %()T is off by the timezone and loses padded-hour formats.
Fixed by wt14/pbbfix (a4107ce, master): the strftime subset lacked %l/%k/%u (and the likewise-literal %V/%G) and hardcoded UTC when TZ was unset. All new specs + ISO-week boundaries + POSIX TZ forms (CST-8/EST5EDT both seasons/UTC/empty=Universal) + the system-timezone fallback (GetTimeZoneInformation) verified line-by-line byte-identical; pbb 076 date segment matches. Anchors: printf.def:633 localtime + glibc strftime. Platform residuals: %Z text is the Windows localized name; Olson TZ names without tzdata stay UTC.
Activity
fix(#326): printf %(fmt)T - %l/%k/%u/%V/%G specs + localtime via the …
caomengxuan666 commentedon Sep 29, 2026
Fixed by wt14/pbbfix (a4107ce, master): the strftime subset lacked %l/%k/%u (and the likewise-literal %V/%G) and hardcoded UTC when TZ was unset. All new specs + ISO-week boundaries + POSIX TZ forms (CST-8/EST5EDT both seasons/UTC/empty=Universal) + the system-timezone fallback (GetTimeZoneInformation) verified line-by-line byte-identical; pbb 076 date segment matches. Anchors: printf.def:633 localtime + glibc strftime. Platform residuals: %Z text is the Windows localized name; Olson TZ names without tzdata stay UTC.