title: Programmatically creating Hangfire cron expression based on user input
body: <p>I have a C# .NET web application with a UI that looks similar to <a href="http://www.cronmaker.com/" rel="nofollow">http://www.cronmaker.com/</a>. The user can select the frequency of a job from many options. I need to be able to create a cron expression to represent the user's desired frequency, and it must be compatible with Hangfire. My ideas were to either:</p>
  
  <ol>
  <li><p>Find an existing library that does it. But I haven't been able to. I heard that Quartz could do it (though it would be overkill), but it seemed that it could create cron expressions for some cases but not others.</p></li>
  <li><p>Make my own tool, using cronmaker.com to figure out the format. However, cronmaker creates cron expressions in a format that Hangfire considers invalid. For "every hour," cronmaker says "0 0 0/1 1/1 * ? *" which Hangfire said was invalid. I found that "0 */1 * * *" works.</p></li>
  </ol>
  
  <p>I need to be able to dynamically generate any cron expression. Surely there's a library out there that can do something like CronLibrary.GetCronExpression(Frequency.EveryNDays, 3, "12:00") with options to cover every conceivable situation. Does anyone know of such a library ?</p>