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 -- Michael Goddard <emmjee@mypostoffice.co.uk>
-----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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJTx5/TAAoJEL/3HArzwYbRpNQP/1U3hEhbKr2DYYq/AS446FFS VnAcEA0flDk+ZX9FMlI0h33COWLivEUcTwUQoqC7LLoOYKAbe+SGs068RdRDCuWm B4dyNc6UIP/zu/SnVKJWoG7pyCA518njsM358uDjvoahC05gwvzs6/uGogAUNKNk OP9p6Olvtq4UytJQOfSGc8aphK4pEynXCyBq8pZJKCHNtlOqKi+n3yjkWiOGlSnd F5qtvj9ZmsDyDK/O5X6lCNJFd4ppdBX68WdPlJUk0Ks41D9oqtfzmWlog/YLfWGo tw8Jln2xglI3JJJc2jXQ2wxp5eTiLsBhgS9JzdhYCnycAR7qFFGexB3VAr5BJvzI upky+MLVpAZfnssKoXaX5cGJX53Ea6ZvcdXd8rjkFSXOAhFiYCduchTWhILkOGvV ZvtlMsm6i/NXUSPOOpBBIxVNlJFdWyvnY/hW48r1vkmR/wcwFZFGaep5GKQSKyKt FpknhnIhZnZQcOt+g7/fdKJNa4TKEN/LyRqLR8PE3LPnhQhCwGAcQHsnz1Ojc1Fi FjeM0lHAuo1bq+Qu/BAeBDQIqPeFLaYPwc8kow0N/qP8PhwSEdA9Wy/4jnIJ2k2M tOhaZ5d18zDl3mC1a2+WFe5bwyTlEXm1VoI7CKNf1b5BzEuRkMsvw6lB/6eafc8C 18dXvI7XjW2ND8+C4lHF =LcIk -----END PGP SIGNATURE-----
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!
-- You can email me securely by sending PGP encrypted messages to prettygood@joebutton.co.uk. The public key's available on public keyservers. If you don't have PGP set up yet, the easiest way is probably to use Thunderbird, Enigmail and GnuPG.
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
participants (4)
-
Joe Button -
Martijn Koster -
Michael Goddard -
Steve Engledow