Your question is hard to understands and your explanation doesn't make it easier, but it seems that you have a certain date X (which is known completely, with day, month and year), and the next n-th day of the month.
Assume you have $d, $m, $y (day, month, year of current date) and $n (billing on n-th day). You can use "date()" to extract the parts if you don't have them split yet.
If $d > $n
, then you will bill them next month. If $d < $n
, it will be this month. If $d == $n
billing is now or next month, your choice.
Adding a month (remember to correctly handle December) will give you the billing date, and you can calculate the difference.
Alternatively, just add a day to the current date in a loop until you hit the billing date...