Errm....
this is bad.
Not that you don't have calendar functs, but you seem to be storing dates as Julian dates.
But, hey... I'll just assume you're storing the year with the J date as well.
The only real way to do this without built in Calendar conversion is to make your own.
basically... run this 12 times:
function monLength($Month, $Year) {
/
counts down from 31 and checks to
see if the date given exits
returns the first found existing date
/
for ($i=31;$i>26;$i--) {
if (checkdate($Month, $i, $Year)) { return $i; }
}
}
That will give you the total days in all 12 months.
Next you'd just count that out... say 31 days in Jan, 28 in Feb and so on and keep adding till you meet or exceed the J date to determine the month. Once you have the month, just subtract the date range of the previous months that were looped through and that should give you the date number for that month.
Anyway, hope that helps.