Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- take current date and
- set its seconds to zero
- set milliseconds to zero
- increase minutes by one
- for some number of tires to not loop forever
- if month matches the month pattern
- while that month doesn't change
- if weekday matches the weekday pattern or day of month matches the day of month pattern
- while day of month doesn't change
- if hour of day maches the hour of day pattern
- while hour of day doesn't change
- if minutes matches the minutes pattern
- yield cron hour
- else
- increase minutes by one
- else
- set minutes to zero
- increase hour of day by one
- else
- set hour of day to zero
- set minutes to zero
- increase day of month by one
- else
- set day of month to one
- set hour of day to zero
- set minutes to zero
- increase month by one
- increase counter of tries by one
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement