I totally agree with
dragonchild about using Date::Calc for date checking and calculation. It greatly simplifies things, and eliminates some subtle and sometimes obscure errors (like checking leap years as above).
(geez, repeat of
Re: Re: Re: Re: Re: Calculating between times? :-)