DateTime-Event-Cron-Quartz

 view release on metacpan or  search on metacpan

lib/DateTime/Event/Cron/Quartz.pm  view on Meta::CPAN

      case sensitive. MON is the same as mon.

=head2 Examples

    Expression                  Meaning
    0 0 12 * * ?                Fire at 12pm (noon) every day
    0 15 10 ? * *               Fire at 10:15am every day
    0 15 10 * * ?               Fire at 10:15am every day
    0 15 10 * * ? *             Fire at 10:15am every day
    0 15 10 * * ? 2005          Fire at 10:15am every day during the year 2005
    0 * 14 * * ?                Fire every minute starting at 2pm and
                                ending at 2:59pm, every day
    0 0/5 14 * * ?              Fire every 5 minutes starting at 2pm and
                                ending at 2:55pm, every day
    0 0/5 14,18 * * ?           Fire every 5 minutes starting at 2pm and ending
                                at 2:55pm, AND fire every 5 minutes starting
                                at 6pm and ending at 6:55pm, every day
    0 0-5 14 * * ?              Fire every minute starting at 2pm and
                                ending at 2:05pm, every day
    0 10,44 14 ? 3 WED          Fire at 2:10pm and at 2:44pm every Wednesday
                                in the month of March.
    0 15 10 ? * MON-FRI         Fire at 10:15am every Monday, Tuesday,
                                Wednesday, Thursday and Friday
    0 15 10 15 * ?              Fire at 10:15am on the 15th day of every month
    0 15 10 L * ?               Fire at 10:15am on the last day of every month
    0 15 10 ? * 5L              Fire at 10:15am on the last Friday of every month
    0 15 10 ? * 5L              Fire at 10:15am on the last Friday of every month
    0 15 10 ? * 5L 2002-2005    Fire at 10:15am on every last friday of every
                                month during the years 2002, 2003, 2004 and 2005
    0 15 10 ? * 5#3             Fire at 10:15am on the third Friday of every month
    0 0 12 1/5 * ?              Fire at 12pm (noon) every 5 days every month,
                                starting on the first day of the month.
    0 11 11 11 11 ?             Fire every November 11th at 11:11am.

Pay attention to the effects of '?' and '*' in the day-of-week
and day-of-month fields!


=head1 SUBROUTINES/METHODS

=over

=item new($cron_expression)

Returns a DateTime::Event::Cron::Quartz object which parses and builds unix-like cron expressions.
If it was an error during expression parsing ParseException is thrown.

=item get_next_valid_time_after($after_datetime)

Returns the next date/time after the given date/time which satisfies the cron expression.

=item is_valid_expression($cron_expression)

Indicates whether the specified cron expression can be parsed
into a valid cron expression.


=back


=head1 BUGS AND LIMITATIONS

* This module is not compatible with unix crontab format. If you are going
to use it for unix crontab processing you should make following changes to it:
add seconds field and set one of day-of-week or day-of-month fields to
unspecified ('?' character)

* Support for specifying both a day-of-week and a day-of-month value is not
complete (you must currently use the '?' character in one of these fields).

* Be careful when setting fire times between mid-night and
1:00 AM - "daylight savings" can cause a skip or a repeat depending on
whether the time moves back or jumps forward.


=head1 AUTHOR

Vadim Loginov <vadim.loginov@gmail.com>


=head1 COPYRIGHT AND LICENSE

Based on the source code and documentation of OpenSymphony
L<http://www.opensymphony.com/team.jsp> Quartz 1.4.2 project licensed
under the Apache License, Version 2.0

Copyright (c) 2009 Vadim Loginov.

This module is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.


=head1 VERSION

0.05

=head1 SEE ALSO

DateTime(3),
L<http://www.opensymphony.com/quartz/api/org/quartz/CronExpression.html>



( run in 0.786 second using v1.01-cache-2.11-cpan-39bf76dae61 )