in reply to Re: Increment through date range by day with only standard modules.
in thread Increment through date range by day with only standard modules.
use strict; use warnings; use POSIX qw( strftime ); use Time::Local qw( timegm ); my ($y1,$m1,$d1) = (2007,23,11); my ($y2,$m2,$d2) = (2007, 4,12); my $date1 = timegm(0,0,0,$d1,$m1-1,$y1); my $date2 = timegm(0,0,0,$d2,$m2-1,$y2); my @dates; for (my $date=$date1; $date<=$date2; $date+=24*60*60) { push @dates, strftime('%Y-%m-%d', gmtime($date)); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Increment through date range by day with only standard modules.
by DStaal (Chaplain) on Dec 12, 2008 at 20:35 UTC | |
by ikegami (Patriarch) on Dec 12, 2008 at 20:59 UTC | |
|
Re^3: Increment through date range by day with only standard modules.
by dbmathis (Scribe) on Dec 12, 2008 at 21:22 UTC |