I am coding a MVC 5 internet application and am using HangFire
for recurring tasks.
If I have a Monthly recurring task, how can I get the value of the next execution time?
Here is my code for the recurring task:
RecurringJob.AddOrUpdate("AccountMonthlyActionExtendPaymentSubscription", () => accountService.AccountMonthlyActionExtendPaymentSubscription(), Cron.Monthly);
I can retrieve the job data as follows:
using (var connection = JobStorage.Current.GetConnection())
{
var recurringJob = connection.GetJobData("AccountMonthlyActionExtendPaymentSubscription");
}
However, I am not sure as to what to do next.
Is it possible to get the next execution time of a recurring task?
Thanks in advance.