in reply to Gettting the last Friday of every month using Time::Piece
poj#!perl use strict; use Time::Piece ; my $year = 2014; foreach my $month ( 1..12 ) { my $t = Time::Piece->strptime("$year/$month/01", "%Y/%m/%d"); my $dd = 34 - $t->_wday; # sun=0 $dd -= 7 if $dd > $t->month_last_day; print "$year $month $dd\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Gettting the last Friday of every month using Time::Piece
by Anonymous Monk on Jun 30, 2014 at 17:58 UTC | |
by LanX (Saint) on Jun 30, 2014 at 18:14 UTC | |
by Jim (Curate) on Jun 30, 2014 at 18:47 UTC | |
by runrig (Abbot) on Jun 30, 2014 at 18:56 UTC | |
by Jim (Curate) on Jun 30, 2014 at 20:10 UTC | |
| |
by LanX (Saint) on Jul 01, 2014 at 14:38 UTC | |
by Jim (Curate) on Jul 03, 2014 at 00:10 UTC |