Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a scenario that I need to schedule a report weekly as per the date and day are chosen from the UI.(Five field cron expression)

please help me with this below question.

if Weekly and it need to start from a particular date, how to mention the start date in that cron expression.

Example

Current Date -14-OCT-2020(Wednesday)

–> if the user scheduling a report today and it needs to be triggered every Monday and this also needs to start from 23-OCT-2020(Friday).....means it need to triggered on 26-OCT-2020(Monday). how to create the cron expression before scheduling in hangfire?


What I have tried:

Tried to construct a cron expression with start date...but I am not able to find the solution.
Posted
Updated 14-Oct-20 21:11pm

1 solution

When I need it, I make use of something like: Free Online Cron Expression Generator and Describer - FreeFormatter.com[^]

Your case looks a little more stringent and not straight forward. Never needed to schedule start date. You can see if the generator supports exact scenario or else you would need to make use of script in expression[^]. In script, you will have full handle on what you want as you can code[^] there as per your requirement.

A similar discussion: quartz scheduler - Cron expression to run every day starting from a date - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900