Skip to content

build: Detect appropriate strftime() year modifier at build time

Different libc implementations (or different platforms) have different bugs. Even though %Y is documented as a 4-digit number, and %C as year/100 in a [00-99] range, they both crap out with years under 1000, using respectively 3 and 1 digits.

This would be typically task for a width modifier (e.g. %4Y, or %2C), but that was conversely found to break NixOS on Darwin.

Since the existing libc bugs paint us to a corner, detect an appropriate modifier at build time to get a 4-digit year to get true ISO 8601 in our supported [0001-9999] year range.

Closes: #402 (closed)

Merge request reports