Your syntax is incorrect. You are attempting to output a string with two digits and a leading zero. But this is only defined for numbers, so to fix just this line:
I don't know why the incorrect format string produces different results in Linux and Windows, but that doesn't really matter.
True, but still strange...
But your function doesn't seem to make sense to me at all. Why don't you use FormatDate()?
Didn't know this function existed (yeee! RTFM)...I found part of my code somewhere here on the forum... but seems FormatDate() does what I want. Thanx for the hint.
gerograph wrote: ↑Fri Jan 16, 2026 10:06 am
Seems like Linux interpretes "0" as "space"
And that is correct according to C printf formatting rules. It's Microsoft's implementation which is off-standard here. I'm afraid there are a few platform-specific gotchas when dealing with printf string and you've just hit one. To workaround it, just use %d instead, e.g.