DateTime::Span::Birth 0.01 is now going to CPAN.

This module is a port of Date::Range::Birth, which allows you to build
a range of dates for birthdays of people with particular age. This
makes it easy for you to build an SQL query for example, to select
teenager users from your database which has 'birth' column as
datetime.

 # build a datetime span for teenagers
 use DateTime::Span::Birth;
 my $span = DateTime::Span::Birth->new(from => 13, to => 19);

 # build an SQL query in a raw way
 my $sql = "SELECT * FROM user WHERE birthday >= ? AND birthdy <= ?"

 my $sth = $dbh->prepare($sql);
 $sth->execute($span->start->ymd, $span->end->ymd);

The code is also available in my subversion repository:
http://svn.bulknews.net/repos/public/DateTime-Span-Birth/trunk/

--
Tatsuhiko Miyagawa

Reply via email to