#!/usr/bin/perl -w use strict; use Date::Tie; use POSIX qw(strftime); tie my %base, "Date::Tie"; my $loops; { tie my %meet, "Date::Tie", year => $base{year}, month => $base{month}, day => 1; # Set the week to the week that has the third tuesday $meet{week} += $meet{weekday} <= 2 ? 2 : 3; # Set the day to tuesday $meet{weekday} = 2; # Use the next month if we already met (or met/meet today) $base{month}++, redo if $meet{yearday} <= $base{yearday} and not $loops++; print strftime "%d %B %Y\n", 0, 0, 0, $meet{day}, $meet{month}-1, $meet{year}-1900; }
(...Rotterdam PM meetings...)
Update - Useful month shifting now (previous went from 19 Nov to 19 Dec, which is not even a tuesday)
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The next third tuesday of the month
by Abigail-II (Bishop) on Nov 13, 2002 at 15:34 UTC | |
by Juerd (Abbot) on Nov 13, 2002 at 19:06 UTC | |
by Abigail-II (Bishop) on Nov 14, 2002 at 13:26 UTC | |
by markguy (Scribe) on Jul 30, 2003 at 23:48 UTC | |
|
Re: The next third tuesday of the month
by feloniousMonk (Pilgrim) on Nov 15, 2002 at 15:25 UTC |