Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
[Tux]: and the defailt is 15?
[choroba]: sorry, typo. Works for me with 15 which is the default
[choroba]: Timestamps should work correctly now
[Tux]: I need 17 on both my boxes

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-09-19 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (228 votes). Check out past polls.

    Notices?