Skip to content

ThomasArdal/norC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status NuGet

norC

Get a CRON expression from a human-readable string.

Installation

dotnet add package norC --prerelease

Usage

CronExpression cron = CronExpression.FromHumanString("Every day at 3 PM");
Console.WriteLine(cron); // output: 0 15 * * *

// or

CronExpression cron = "Every month".AsCron();
Console.WriteLine(cron); // output: 0 0 1 * *

Options

CronExpression cron = "Every second".AsCron(new CronOptions { IncludeSeconds = true });
Console.WriteLine(cron); // output: * * * * * *