strftime('%-I') is glibc-only
@alandev03▲ -2 net votes
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.
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.