.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DateTime::Cron::Simple 3" .TH DateTime::Cron::Simple 3 2024-02-07 "perl v5.38.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME DateTime::Cron::Simple \- Parse a cron entry and check against current time .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use DateTime::Cron::Simple; \& \& $c = DateTime::Cron::Simple\->new($cron); \& \& $boolean = $c\->validate_time; \& \& $c\->new_cron($cron); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module is a quick and dirty way to determine if a cron time format is valid for the current date and time. .PP A cron entry follows the cron format from \fBcrontab\fR\|(5). .PP The validate_time function uses the current date and time for comparison, but will also accept a valid DateTime object as a parameter. .SS FUNCTIONS .IX Subsection "FUNCTIONS" .IP \fBnew\fR 4 .IX Item "new" .Vb 1 \& $c = DateTime::Cron::Simple\->new(\*(Aq0\-59/2 10,12 * * 5\*(Aq); .Ve .Sp Creates a cron entry. .IP \fBnew_cron\fR 4 .IX Item "new_cron" .Vb 1 \& $c\->new_cron($cron); .Ve .Sp Updates the cron entry to the given argument. .IP \fBvalidate_time\fR 4 .IX Item "validate_time" .Vb 2 \& $boolean = $c\->validate_time; \& $boolean = $c\->validate_time($dt); .Ve .Sp Validates a datetime against the cron entry. If the argument is ommitted, it validates against the current time (\f(CW\*(C`DateTime\-\*(C'\fRnow>). .IP \fB_parse_cron_field\fR 4 .IX Item "_parse_cron_field" .Vb 1 \& $data = $c\->_parse_cron_field($field, $min, $max) .Ve .SH EXAMPLE .IX Header "EXAMPLE" .Vb 1 \& use DateTime::Cron::Simple; \& \& $c = DateTime::Cron::Simple\->new(\*(Aq0\-59/2 10,12 * * 5\*(Aq); \& \& if($c\->validate_time) { ... } \& \& $c\->new_cron(\*(Aq* * 1 * 0\*(Aq); \& \& if($c\->validate_time) { ... } .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& DateTime::Event::Cron .Ve .PP It is very likely that this module will soon be deprecated. It was created without coordination with the developers of DateTime modules, which may be reached via .PP .Vb 2 \& http://datetime.perl.org/ \& datetime@perl.org (the mailing list) .Ve .PP This module would better belong to the DateTime::Event namespace or else have its functionality incorporated into DateTime::Event::Cron. This release is transitional, while the right way to do it is being studied. .SH AUTHORS/MAINTAINERS .IX Header "AUTHORS/MAINTAINERS" The original author of this module is .PP Brendan Fagan . .PP At version 0.3, a full rewrite was done to set it free from license issues. The current maintainer is .PP Adriano Ferreira . .PP Comments, bug reports, patches and flames are still appreciated. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Brendan Fagan holds the copyright from 2002 to 2006 over versions 0.1 and 0.2 of the distribution. .PP Copyright (C) 2006 by A. R. Ferreira .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.