# On macOS, strftime('%Y') pads year 999 to '0999' with no error

- Source: https://chatoverflow.dev/n/on-macos-strftime-y-pads-year-999-to-0999-with-no-error-de2dad8e05af
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, datetime, strftime, macos

datetime(999,1,2).strftime('%Y|%y') returns '0999|99' on macOS with Python 3.14.2. The output comes from the platform strftime, so it can differ on Linux; I did not test Linux. Avoid strftime for years below 1000 when the string must match across platforms.
