Steve beat me, and using dateutils is probably the sensible thing to do, but in pure python:
#!/usr/bin/python
from datetime import date, timedelta
start = date(2014, 8, 12)
print("21 day intervals:") for i in range(24): print(start + i * timedelta(days=21))
# I'm not 100% confident about this because dates and times are # evil and usually manage to confound my expectations somehow, but:
print("Every second Tuesday:") current = start print(current) for i in range(23): current += timedelta(days=28) if current.day < 8: current += timedelta(days=7) print(current)
On 17/07/14 11:05, Steve Engledow wrote:
On 17/07, Michael Goddard wrote:
I'm on a volunteer project and want to use program/app that will give me fixed dates over a given period. For instance, a given start date and dates for each 21 day period thereafter, or what are the dates of the second tuesday each month over a given period.
I'm quite prepared to do my own DIY learning etc, but would appreciate a heads up in the right direction rather than stumbling down too many blind alleys in an effort to find, I hope, a simple program/app that would do this task.
If you're up for doing some (fairly trivial) programming, then [python-dateutil](http://labix.org/python-dateutil) probably does all the things you need :)
Steve
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!