Thats easy. You need to find date difference between the 1st of the current month and the 1st of the following month.
It's pretty obvious how to get the date of the 1st of the following month. (it's just a string manipulation with current date. Dont forget about the exlusion of the 12th month)
Then apply ...