https://github.com/thomasardal/norc
Get a CRON expression from a human-readable string
https://github.com/thomasardal/norc
cron cron-expression cron-job cron-jobs cronjob
Last synced: about 2 months ago
JSON representation
Get a CRON expression from a human-readable string
- Host: GitHub
- URL: https://github.com/thomasardal/norc
- Owner: ThomasArdal
- License: apache-2.0
- Created: 2023-02-08T12:10:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T14:18:05.000Z (over 3 years ago)
- Last Synced: 2025-01-15T22:35:45.764Z (over 1 year ago)
- Topics: cron, cron-expression, cron-job, cron-jobs, cronjob
- Language: C#
- Homepage: https://thomasardal.com
- Size: 133 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/ThomasArdal/norC/actions/workflows/build.yml)
[](https://www.nuget.org/packages/norC)
# norC
Get a CRON expression from a human-readable string.
## Installation
```
dotnet add package norC --prerelease
```
## Usage
```csharp
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
```csharp
CronExpression cron = "Every second".AsCron(new CronOptions { IncludeSeconds = true });
Console.WriteLine(cron); // output: * * * * * *
```