Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Accounting Calendar using Date::Calc

by fglock (Vicar)
on Jun 07, 2005 at 22:14 UTC ( #464477=note: print w/ replies, xml ) Need Help??


in reply to Accounting Calendar using Date::Calc

If you don't mind installing a module, here is how to use DateTime::Event::Recurrence (I guessed the parameters from your example):

use DateTime::Event::Recurrence; my $cal = DateTime::Event::Recurrence->yearly( weeks => 5, week_start_day => 'su' ); my $dt = DateTime->new( year=> 2004 ); for ( 1 .. 10 ) { $dt = $cal->next( $dt ); print $dt, "\n" }
2004-02-01T00:00:00
2005-01-30T00:00:00
2006-01-29T00:00:00
2007-01-28T00:00:00
2008-01-27T00:00:00
2009-02-01T00:00:00
2010-01-31T00:00:00
2011-01-30T00:00:00
2012-01-29T00:00:00
2013-01-27T00:00:00

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://464477]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2016-06-25 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (322 votes). Check out past polls.