-
-
11 Jul 2016 09:03:59 UTC
- Distribution: Time-Crontab
- Module version: 0.04
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (2808 / 0 / 13)
- Kwalitee
Bus factor: 1- 90.42% Coverage
- License: perl_5
- Perl: v5.8.5
- Activity
24 month- Tools
- Download (11.48KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Time::Crontab - parser for crontab date and time field
SYNOPSIS
use Time::Crontab; my $time_cron = Time::Crontab->new('0 0 1 * *'); if ( $time_cron->match(time()) ) { do_cron_job(); }
DESCRIPTION
Time::Crontab is a parser for crontab date and time field. And it provides simple matcher.
METHOD
- new($crontab:Str)
-
Returns Time::Crontab object. If incorrect crontab string was given, Time::Crontab dies.
- match($unix_timestamp:Num)
-
Returns whether or not the given unix timestamp matches the crontab Timestamps are truncated to minute resolution.
SUPPORTED SPECS
Field name Allowed values Allowed special characters Minutes 0-59 * / , - Hours 0-23 * / , - Day of month 1-31 * / , - Month 1-12 or JAN-DEC * / , - Day of week 0-6 or SUN-SAT * / , -
Predefined scheduling definitions are not supported. In month and day_of_week fields, Able to use the first three letters of day or month. But does not support range or list of the names.
RELATED MODULES
- DateTime::Event::Cron
-
DateTime::Event::Cron that depends on DateTime. Time::Crontab does not require DateTime or Time::Piece.
- Algorithm::Cron
-
Algorithm::Cron also does not require DateTime. It's provides `next_time` method, Time::Crontab provides `match` method.
LICENSE
Copyright (C) Masahiro Nagano.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Masahiro Nagano <kazeburo@gmail.com>
Module Install Instructions
To install Time::Crontab, copy and paste the appropriate command in to your terminal.
cpanm Time::Crontab
perl -MCPAN -e shell install Time::Crontab
For more information on module installation, please visit the detailed CPAN module installation guide.