Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Accounting Calendar using Date::Calc

by fglock (Vicar)
on Jun 07, 2005 at 22:14 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://464477]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-18 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found