General information
Category:
Coding, syntax and commands
>>>I need to implement a schedule-based process using a CRON. Anyone know of a function or any code where I can pass in a CRON and get back a bool if it's time to run?
>>
>>I thought CRON was a Unix daemon for task scheduling. What do you mean by 'pass in a CRON' ?
>
>It is a unix thing but for some reason we're using it here in our C# apps. So I have to use it.
>
>I want to pass in a CRON expression, ie "* * * * * " or something like it, and get back a bool if the expression evaluates to DateTime.Now or past DateTime.Now.
OK - that looks like a cron table entry. But how likely is it, given that you can translate a cron value to a datetime struct, that if will be exactly the same as DateTime.Now ? (It can always be considered as 'past' because cron table entries don't specify a year)
FWIW cron table entries are defined down to the minute level.
UPDATE: Also, an added wrinkle, a single cron table entry can effectively refer to multiple times....
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only