The version that they teach in Dudley goes a little differently from some others (at least as I remember it):

Thirty days have September,
April, June, and November
All the rest have thirty-one
Except for that quite contrary February
which has twenty-eight most of the time
Except in leap-year, twenty-nine

A friend recently raised a very good point. In the time it takes to memorize the poem itself as a child, one might as well memorize the months and their associated number of days. But, I digress. The following is the version I was taught. It has been permanently fixed in my memory since my early childhood with no hope of removal.

Thirty days hath September,
April, June, and November.
All the rest have thirty-one
Except for February
Which has twenty-eight days, clear,
And twenty-nine in each leap year.
Rather than using this silly poem (which I never was able to learn), one can refer to a handy reference tool that at all (or at least most) of us have: our hands. Start with the pinky knuckle of your left hand. That's January. The trough between that and the next knuckle is February. Count the rest of the months as so. When you get to the last knuckle on your left hand, July, then go over to the index knuckle on your right hand, for August. Continue to the ring finger knuckle of your right hand, for December.

Anytime a month is associated with a knuckle, it has 31 days; when it's in a trough, it doesn't. Everyone knows that February is the funky month, and those months that aren't 31 days long and aren't Februrary are 30 days long.

Magic!