{"id":37061117,"url":"https://github.com/yisoft-dotnet/crontab","last_synced_at":"2026-01-14T06:55:15.588Z","repository":{"id":263272488,"uuid":"88170101","full_name":"yisoft-dotnet/crontab","owner":"yisoft-dotnet","description":"cron expression parser and executor for dotnet core.","archived":false,"fork":false,"pushed_at":"2017-06-27T07:51:32.000Z","size":49,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-01T01:03:35.563Z","etag":null,"topics":["cron","cron-expression","crontab","crontab-task","dotnet","dotnet-standard","executor","scheduled-jobs","task-scheduler","yisoft","yiteam"],"latest_commit_sha":null,"homepage":"https://yi.team","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yisoft-dotnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-13T13:52:25.000Z","updated_at":"2024-04-01T08:30:09.000Z","dependencies_parsed_at":"2024-11-17T13:45:02.877Z","dependency_job_id":"ce597137-cf98-4b04-9b1e-0ed9aa0a78a3","html_url":"https://github.com/yisoft-dotnet/crontab","commit_stats":null,"previous_names":["yisoft-dotnet/crontab"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/yisoft-dotnet/crontab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisoft-dotnet%2Fcrontab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisoft-dotnet%2Fcrontab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisoft-dotnet%2Fcrontab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisoft-dotnet%2Fcrontab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yisoft-dotnet","download_url":"https://codeload.github.com/yisoft-dotnet/crontab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisoft-dotnet%2Fcrontab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","cron-expression","crontab","crontab-task","dotnet","dotnet-standard","executor","scheduled-jobs","task-scheduler","yisoft","yiteam"],"created_at":"2026-01-14T06:55:15.036Z","updated_at":"2026-01-14T06:55:15.582Z","avatar_url":"https://github.com/yisoft-dotnet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Yisoft.Crontab #\n\n[![Build status](https://ci.appveyor.com/api/projects/status/mgms413qy8s0y181?svg=true)](https://ci.appveyor.com/project/yiteam/crontab)\n[![NuGet](https://img.shields.io/nuget/v/Yisoft.Crontab.svg?style=flat\u0026label=nuget)](https://www.nuget.org/packages/Yisoft.Crontab/)\n\ncron expression parser and executor for dotnet core.\n\n\u003e this project based on [NCrontab-Advanced](https://github.com/jcoutch/NCrontab-Advanced).\n\nIf you have any problems, make sure to file an issue here on Github.\n\n# Crontab task executor #\n\n## CronAttribute ##\nThis library support annotation method only. if you want create a crontab task, simply add the `CronAttribute` on some method.\n\nWe also provide some advanced features that you can get by adding some parameters to the method to get the information associated with the current task.\n\nHere are some [samples](sample):\n```csharp\npublic class TestScheduler\n{\n\t[Cron(\"18/1 * * * * ? *\", CronStringFormat.WithSecondsAndYears)]\n\tpublic static void Task1()\n\t{\n\t\tDebug.WriteLine($\"Task..............1111_{DateTime.Now}\");\n\t}\n\n\t[Cron(\"28/1 * * * * ? *\", CronStringFormat.WithSecondsAndYears)]\n\tpublic static void Task2(DateTime time, CrontabTask task)\n\t{\n\t\tDebug.WriteLine($\"Task..............2222_{time}_{task.Method.Name}\");\n\t}\n\n\t[Cron(\"28/1 * * * * ? *\", CronStringFormat.WithSecondsAndYears)]\n\tpublic static void Task3(DateTime time, CrontabTask task)\n\t{\n\t\tDebug.WriteLine($\"Task..............3333_{time}_{task.Method.Name}\");\n\t}\n\n\t[Cron(\"1-8 * * * * ? *\", CronStringFormat.WithSecondsAndYears)]\n\t[Cron(\"48/1 * * * * ? *\", CronStringFormat.WithSecondsAndYears)]\n\tpublic static void Task4(DateTime time, CrontabTask task, CrontabTaskExecutor taskExecutor)\n\t{\n\t\tDebug.WriteLine($\"Task..............Cron_{time}_{task.Method.Name}_{taskExecutor.Tasks.Count}\");\n\t}\n\n\t// this task will begin execution after 100 seconds of startup\n\t[Cron(\"0/1 * * * * *\", 100, CronStringFormat.WithSeconds)]\n\tpublic static void DeferTask1()\n\t{\n\t\tDebug.WriteLine($\"Task..............5555_{DateTime.Now}\");\n\t}\n}\n```\n\n## Constructor ##\n\nThe `CrontabTaskExecutor` class contains a constructor that with one parameter, the parameter is `Func\u003cMethodInfo, object\u003e typeInstanceCreator`. `typeInstanceCreator` used to create an object instance where the task method is definded. this will be very useful!\n\nIn console application, you can initialize an instance of an object with the `new` keyword or reflection. and in web application, you can use `DI`(`dependency injection`) directly.\n\nFor better use this library in your Web application, see the [Yisoft.AspNetCore.Crontab](https://github.com/yisoft-aspnet/crontab) project.\n\n# Support for the following cron expressions #\n\n```\nField name   | Allowed values  | Allowed special characters\n------------------------------------------------------------\nMinutes      | 0-59            | * , - /\nHours        | 0-23            | * , - /\nDay of month | 1-31            | * , - / ? L W\nMonth        | 1-12 or JAN-DEC | * , - /\nDay of week  | 0-6 or SUN-SAT  | * , - / ? L #\nYear         | 0001–9999       | * , - /\n```\n\n## Related community projects\n* [Yisoft.AspNetCore.Crontab](https://github.com/yisoft-aspnet/crontab)\n\n# License\nReleased under the [Apache License](License.txt).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyisoft-dotnet%2Fcrontab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyisoft-dotnet%2Fcrontab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyisoft-dotnet%2Fcrontab/lists"}