我正在尝试返回今天的生日。这就是我现在所拥有的,它有效,但我需要获取月份和日期才能输入到语句中。我想也许我可以从本地时间获取它们,但这并没有成功。任何建议,将不胜感激。
sub author_birth {
my ($self) = @_;
my ($day,$month) = (localtime())[3..4];
my $author_result = $self->search_like(
{
birth => '%03-20'
},
{
select => [
'id',
'complete_name',
],
#result_class => 'DBIx::Class::ResultClass::HashRefInflator'
}
);
my @author_ids = ();
while (my $row = $author_result->next) {
push @author_ids, $row->id;
}
return $self->get_author_info_by_id(\@author_ids);
}