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.
Tia Michael
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
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
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!
On Thu, 17 Jul 2014 11:05:07 +0100 Steve Engledow steve@offend.me.uk wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
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 :)
Many thanks to all who responded - very helpful.
Michael
On 17 Jul 2014, at 10:09, Michael Goddard emmjee@mypostoffice.co.uk wrote:
I'm on a volunteer project and want to use program/app that will give me fixed dates over a given period.
Maybe some app exists, but I don’t know. It’s easy enough to script though.
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.
Here is some python code to get you started: https://gist.github.com/makuk66/c68462d2d86701fd32a0
— Martijn