C# library for generating cron expressions from given times and dates.
CronEspresso allows the creation of cron strings at run time, removing the need to hard code cron string values into the source code. This can be helpful in projects where cron strings need to be created on the fly or are generated based on variable values within the code (e.g. run every 2 hours from the current time), CronEspresso has easy to read methods that can be called to produce a cron string to suit the given parameters.
Example Usage:
//// Once the package is installed include this in your using
using CronEspresso;
//// Cron a cron that runs every 6 hours
var hourlyCron = CronGenerator.GenerateHourlyCronExpression(6);
Console.WriteLine(hourlyCron); //// This would output "0 0 0/6 1/1 * ? *"
//// Cron a cron that runs every day at 14:00
var dailyCron = CronGenerator.GenerateDailyCronExpression(new TimeSpan(14, 0, 0));
Console.WriteLine(dailyCron); //// This would output "0 0 14 1/1 * ? *"
//// For a full list of methods and how to use them please visit the github wiki page.To use CronEspresso in your solution download the NuGet package via Visual Studio's package manager (search for 'CronEspresso') or run the following line to get the most recent version. The current version is a dot net standard 2.0 package
Install-Package CronEspresso
For detailed documention on how to use the package, visit the GitHub Wiki
* Converted whole project to be a dot net standard 2.0 package
* Minor spelling mistakes corrected, no code logic changed in this release
* Implementation of cron validation method which validates a given cron string
* Removal of empty deserialization class until version 2 is released
* Additon of yearly cron creation implemented
* Refactor of the validation within the cron generator
* Initial Release