Ohh screw it - I tried extracting the specific code from the Time library that does the breakdown down of the time stamp and calculates the date (as opposed to the time) but it was like pulling a weed.
There was always some extra bit of code that I needed to extract from the library to make it compile in my project.
In the end I just gave up and included the Time library and just used the existing functions - it does not appear to be a big library anyway.
Calculation of day of month, month and year seems to be similar to what I was trying to do.
But I have not gotten to grips with how it handles the fact that a year is 365.25 days with ending up with rounding errors that results in the day of month being sometimes one too less or one too many.
If you want an assessment of the code you have written, post it and maybe someone here can suggest an improvement.
OK. It is often better not to attempt to re-invent the wheel.
The rules for handling leap years are quite well known and I can imagine the person who wrote the 'time' library had at least a vague understanding of what he was doing and did some testing. At least, I have had no problems with it.