Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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


Comment on Re: Accounting Calendar using Date::Calc
Download Code

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 making s'mores by the fire in the courtyard of the Monastery: (21)
As of 2014-08-20 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (116 votes), past polls