Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # IT:AD:NCronTab # <callout type="Navigation" class="small"> * [[../|(UP)]] </callout> <panel title="Summary"> When you want a library to parse a Cron schedule, without the scheduling part, then you can use the NCronTab library. </panel> ## Process ## <sxh csharp> void Main() { //Consider checking the schedule in the worker, and not the db (!). //add a single column to the Adapter Column, and call it schedule... eg: to happen at 2:05am: var exampleAdapterRecord =new {Id=123,Schedule="05 02 * * *", Etc="..."}; //Check for what's happening within the next minute, or next n days: var schedule = NCrontab.CrontabSchedule.Parse(exampleAdapterRecord.Schedule); var next = schedule.GetNextOccurrences(DateTime.Now, startTime.AddDays(3)); foreach(var x in next){ x.Dump();} } </sxh> Output of above would be: <sxh> 27/08/2015 2:05:00 a.m. 28/08/2015 2:05:00 a.m. 29/08/2015 2:05:00 a.m. </sxh> /home/skysigal/public_html/data/pages/it/ad/ncrontab/home.txt Last modified: 2023/11/04 03:27by 127.0.0.1