That’s very strange… As you say, it’s not really a juce thing, because all the numbers just get passed to the standard c library. Maybe it’s got the timezone screwed up or something and that’s throwing off the maths…?
I’m following this up, just in case anyone else experiences something similar:
I don’t currently have time to dig down to the actual culprit, but as far as I can tell, the date offset is happening only in app that also uses SQLite and DCMTK - which makes me think that it is being caused by some odd interplay of libraries or includes.
It actually seems to be confusion between zero and non-zero indexed days and months. Maybe one day if I care, I’ll try and find out why. Not a JUCE problem though, and in my case, easily solvable but just brute force building the date string.