2 #run nightly -- changes J to A on someone's 18th birthday
5 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
8 $mon +=1; if ($mon < 10) {$mon = "0".$mon;}
9 if ($mday < 10) {$mday = "0".$mday;}
11 $year -=18; #18 year olds here: if your J turns to A before this change here
12 my $dbh=C4::Context->dbh;
14 #get today's date, format it and subtract 18 yrs.
15 my $itsyourbirthday = "$year-$mon-$mday";
17 my $query=qq|UPDATE borrowers
21 AND dateofbirth!='0000-00-00'
22 AND categorycode IN (select categorycode from categories where category_type='C')|;
23 my $sth=$dbh->prepare($query);
24 my $res = $sth->execute($itsyourbirthday) or die "can't execute";
25 print "$res\n"; #did it work?