Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Representing windows of time in a string

by simonm (Vicar)
on Oct 30, 2003 at 16:50 UTC ( [id://303315]=note: print w/replies, xml ) Need Help??


in reply to Representing windows of time in a string

Strictly speaking, crontab schedules define "points" in time when the specific actions are triggered, whereas it seems you need a broader "range" or "set" of time spans.

It might be overkill, but I think you should be able to accomplish this with the DateTime modules.

For example, take a look at DateTime::Event::ICal... Using the ICal format, you could express your rules as:

my $incident = DateTime->from_epoch( time() ); # your data here my $ok_down = DateTime::Event::ICal->recur( byday=>["su"], byhour=>[ +6, 7] ); unless ( $ok_down->contains( $incident ) { # notify }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://303315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found