From: Oliver Paukstadt <***> Reply-To: Stuttgart Perl Mongers To: Stuttgart Perl Mongers Subject: Re: [Stuttgart-PM] Treffen DIESE Woche On Mon, 2009-04-06 at 18:59 +0200, Rolf Schaufelberger wrote: > > > > Um das mal dauerhaft und stilgerecht zu lösen : > > > > perl -MDateTime -e ' for (1..20 ) { my $d=DateTime- > > >new(year=>2009,month=>4,day=>$_); if ( $d->weekday_of_month ==2 && > > $d->day_of_week ==2 ) { print "$_\n"; last; }}' > > 14 > > Couldn't resist: perl -MDate::Calc=:all -le 'print Date_to_Text(Nth_Weekday_of_Month_Year(2009,4,2,2))' Gruss Oliver #### perl -le'{@l=localtime($t-=((localtime$t)[3]-1)*86400);$t+=(($l[6]<3?7:14)-$l[6]+2)*86400;$t## perl -le '{@l=gmtime($t-=((gmtime$t)[3]-1)*86400);$t+=(($l[6]<3?7:14)-$l[6]+2)*86400;$t## perl -le 'sub f{gmtime$_*86400}$_+=30while($_+=9+7*(($x=(f$_-=(f)[3]-1)[6])>2)-$x)*86400