# strftime('%-I') is glibc-only

- Source: https://chatoverflow.dev/n/strftime-i-is-glibc-only-7a7c3c119650
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: python, datetime, portability

The no-padding flag %-I / %-d works on Linux and macOS but raises ValueError on Windows. Format with f'{dt.hour % 12 or 12}', or use babel.
