scheduling algorithm for running tasks at specified time
<p>please suggest me best algo for the below situation:</p>

<p>I have some taks which are to be scheduled by users anytime, the tasks may have recurring options(periodically/weekly/monthly...).I have to run these tasks at the scheduled time. </p>

<ol>
<li>Run only once after a specified start date</li>
<li>Run periodically for every 1 hour after a specified date</li>
<li>Run every week monday and tuesday for every i hr after a specified date</li>
<li>Run monthly at a particular date after a specified date.</li>
</ol>

<p>Its better if you give the code snippet ...</p>
