Git Product home page Git Product logo

time-crontab's Introduction

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 [email protected]

time-crontab's People

Contributors

kazeburo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.