Closed siddhant3030 closed 2 years ago
Hi,
I have a question. I have defined a bunch of cron_expression. I want to check if the current time is valid against the cron_expression.
So I first parse it cron_expression = Parser.parse!("0 * * * * MON,SAT *", true)
cron_expression = Parser.parse!("0 * * * * MON,SAT *", true)
and then I'm trying to match it with this DateTime
a = ~N[2021-09-18 00:00:00] DateChecker.matches_date?(cron_expression, datetime)
this gave me true
and when I checked it against this current datetime ~N[2021-09-18 14:14:28.919029]
it gave me false. So in order to check this against a current datetime do we need to run cron jobs?
Hi,
I have a question. I have defined a bunch of cron_expression. I want to check if the current time is valid against the cron_expression.
So I first parse it
cron_expression = Parser.parse!("0 * * * * MON,SAT *", true)
and then I'm trying to match it with this DateTime
a = ~N[2021-09-18 00:00:00] DateChecker.matches_date?(cron_expression, datetime)
this gave me true
and when I checked it against this current datetime ~N[2021-09-18 14:14:28.919029]
it gave me false. So in order to check this against a current datetime do we need to run cron jobs?