Download the TimeConvert UDF and try this:
 Code:
$NumDays = SubStr(TimeConvert(TimeConvert(first_day_of_next_month) - 86400), 8, 2)

Such, if I want to know how many days were in Feb this year, I'd run
 Code:
$NumDays = SubStr(TimeConvert(TimeConvert(2007/3/1) - 86400), 8, 2)

This obtains the cTime value for midnight of March first, subtracts 86400 (one day in seconds), and converts back to YYYY/MM/DD HH:MM:SS format. The SubStr pulls out the day value, which will always be an accurate last day of the month, which, of course, is the number of days in the month.

I used to use an array for most months, and calculate Feb, but this method is so easy I don't bother anymore.

Glenn

PS - cTime is a date/time value represented as the number of seconds that elapsed from "the epoch" - a specific point in time. The UDF uses 1/1/1970 by default, but can be changed to any date in history. Makes it very easy to calculate the time between dates. The UDF takes some handy arguments, like "now" and "today" to simplify timing events.
_________________________
Actually I am a Rocket Scientist! \:D