Template:Days before month

Usage: gives the number of days before the given month. leapyear is optional, use "leapyear=1" if you're calculating for a leap year.