GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Time::Crontab(3) User Contributed Perl Documentation Time::Crontab(3)

Time::Crontab - parser for crontab date and time field

    use Time::Crontab;

    my $time_cron = Time::Crontab->new('0 0 1 * *');
    if ( $time_cron->match(time()) ) {
        do_cron_job();
    }

Time::Crontab is a parser for crontab date and time field. And it provides simple matcher.

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.

  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.

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.

Copyright (C) Masahiro Nagano.

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

Masahiro Nagano <kazeburo@gmail.com>
2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.