DESCRIPTION

This module provides convenience methods that let you easily create DateTime::Set objects for various recurrences, such as "once a month" or "every day". You can also create more complicated recurrences, such as "every Monday, Wednesday and Thursday at 10:00 AM and 2:00 PM".

USAGE

yearly monthly weekly daily hourly minutely secondly

These methods all return a new DateTime::Set object representing the given recurrence.

my $daily_set = DateTime::Event::Recurrence->daily;

If no parameters are given, then the set members each occur at the beginning of the specified recurrence.

For example, by default, the monthly() method returns a set containing the first day of each month.

Without parameters, the weekly() method returns a set containing Mondays.

However, you can pass in parameters to alter where these datetimes fall. The parameters are the same as those given to the DateTime::Duration constructor for specifying the length of a duration. For example, to create a set representing a daily recurrence at 10:30 each day, we write this:

A recurrence can be affected DST changes, so it would be possible to specify a recurrence that creates nonexistent datetimes. Because DateTime.pm throws an exception if asked to create a non-existent datetime, please be careful when setting a time zone for your recurrence.

It might be preferable to always use "UTC" for your sets, and then convert the returned object to the desired time zone.

Leap Seconds

There are no leap seconds, because the recurrences are created in the 'floating' time zone.

The value 60 for seconds (the leap second) is ignored. If you really want the leap second, then specify the second as -1.

AUTHOR

Flavio Soibelmann Glock fglock@pucrs.br

CREDITS

The API was developed with help from the people in the datetime@perl.org list.

Special thanks to Dave Rolsky, Ron Hill and Matt Sisk for being around with ideas.

If you can understand what this module does by reading the docs, you should thank Dave Rolsky. If you can't understand it, yell at him. He also helped removing weird idioms from the code.

Jerrad Pierce came with the idea to move "interval" from DateTime::Event::ICal to here.

COPYRIGHT

Copyright (c) 2003 Flavio Soibelmann Glock. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO

datetime@perl.org mailing list

DateTime Web page at http://datetime.perl.org/

DateTime - date and time :)

DateTime::Set - for recurrence-set accessors docs. You can use DateTime::Set to specify recurrences using callback subroutines.

DateTime::Event::ICal - if you need more complex recurrences.

DateTime::SpanSet - sets of intervals, including recurring sets of intervals.