'Validate date limits.'

def check_date_limit(self, data, verbose=False):

    if (self.upper_date_limit or self.lower_date_limit):
        date_fmt = '%a    %b    %d    %H:%M:%S    +0000    %Y'
        tweet_date = datetime.strptime(data['created_at'], date_fmt).replace(tzinfo=UTC)
        if ((self.upper_date_limit and (tweet_date > self.upper_date_limit)) or (self.lower_date_limit and (tweet_date < self.lower_date_limit))):
            if self.upper_date_limit:
                message = 'earlier'
                date_limit = self.upper_date_limit
            else:
                message = 'later'
                date_limit = self.lower_date_limit
            if verbose:
                print 'Date    limit    {0}    is    {1}    than    date    of    current    tweet    {2}'.format(date_limit, message, tweet_date)
            self.do_stop = True
