Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recurrence calculator

Tags:

c#

.net

I am working on a C# application that relies heavily on recurring events. Following kinds of recurrence are supported:

  1. Daily recurrence
  2. Weekly recurrence
  3. Monthly recurrence

Basically, the application supports all the different combination of recurrences as supported by MS Outlook.

The problem:

The individual occurrence as calculated by the system for a recurring event does not consider the daylight savings and as a result the occurrence date time is displaying wrongly by the system. Is there a standard library or third party module available that can handle recurrence date calculations? Basically I want an API in the below format.

List<Occurence> GetAllOccurences(DateTime startTimeInUTC, DateTime EndTimeInUTC,    TimeZone targetTimeZone)

class Occurrence
{
    DateTime OccurenceStartDateTime {get;set;}
    DateTime OccurenceEndDateTime {get;set;}
}

Is such an API available? It could make my life much easier.

like image 242
papfan Avatar asked Nov 13 '22 00:11

papfan


1 Answers

This may help Task Scheduler Or search for Cron libraries, there are a couple of different ones and one of them should do as you wish.

like image 134
Khadaji Avatar answered Nov 15 '22 12:11

Khadaji