According to the documentation, strftime
accepts a %e
character in format parameter that returns the "day of the month, with a space preceding single digits".
So if I use it in order to display localized date I've got two different results, if I'm at the beginning of the month or the end of the month:
echo strftime('%A %e %B' . PHP_EOL);
// Displays: Monday 5 February
echo strftime('%A %e %B' . PHP_EOL, time() + 400000);
// Displays: Saturday 10 February
It's annoying and a bit weird. I don't know why this space is here (historical reasons?), I don't see any case where it's useful. But that's not the real question.
Is there a way to display a day number using strftime
without leading space (and without leading zero)?