Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: RFC: List of first day of each month

by haukex (Archbishop)
on Jan 31, 2020 at 16:47 UTC ( [id://11112195]=note: print w/replies, xml ) Need Help??


in reply to RFC: List of first day of each month

TIMTOWTDI, I'm a fan of DateTime:

use warnings; use strict; use DateTime; my $now = DateTime->now; my $start = DateTime->new( year=>$now->year-4 ); my $end = $now; my $dt = $start->clone; $dt->truncate(to=>'month')->add(months=>1) if $dt->day!=1; for ( ; $dt<$end; $dt->add(months=>1) ) { print $dt->ymd, "\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11112195]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-03-29 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found