Pretty simple equation to show the last day of a month. First, get the first day of next month.
Then we'll simply subtract one day from that new date.
You could put this all into one long line, but I split it up for easier readability.
If you want to set it up as a function, the pass in the date as "datePassed" to the following code, and you will get the last day in that month:
<cfargument name="datePassed" type="date" required="Yes">
<cfset createdNextMonthDate = CreateDate(year(arguments.datePassed),month(dateAdd('m',1,arguments.datePassed)),1)>
<cfset lastDayOfMonthForAdStartDate = dateAdd('d',-1,createdNextMonthDate)>