Information générale
Catégorie:
Code, syntaxe and commandes
>>>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....
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement