in reply to Re^3: List of days in current month
in thread List of days in current month
#!/usr/bin/perl use warnings; use strict; use DateTime; my $dt = 'DateTime'->new( year => 2014, month => 3, day => 14, hour => 0, minute => 0, second => 0, time_zone => 'America/New_York', ); while (1) { my $yesterday = $dt->clone; $yesterday->subtract(days => 1); my $diff = $dt->epoch - $yesterday->epoch; $dt = $yesterday; print "$dt\t$diff\n"; last if $diff != 60 * 60 * 24; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: List of days in current month
by Lennotoecom (Pilgrim) on Mar 14, 2014 at 18:03 UTC |