Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品与服务 | Email

6.7. Date::Manip

		
use Date::Manip;

sub _time_limit {
    my ($self, $date, $limit) = @_;
    my $now = localtime(time());
    my $current_date = ParseDate($now);
    my $pub_date = ParseDate($date);
    my $limit_date = DateCalc($current_date, "-$limit month");
    $pub_date =~ s/\:.*$//;
    $limit_date =~ s/\:.*$//;
    if ($pub_date > $limit_date) {
        return 1;
    }else{
        return 0;
    }
		
		
comments powered by Disqus