Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Given month last day

by toolic (Bishop)
on Aug 28, 2015 at 18:29 UTC ( [id://1140368]=note: print w/replies, xml ) Need Help??


in reply to Given month last day

One way:
use strict; use warnings; use Time::Piece; my $month = 11; my $t = Time::Piece->strptime($month, '%m'); my $last_day_month = $t->month_last_day(); print "$last_day_month\n"; __END__ 30

To account for leap years, you may need to also specify the year.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-23 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found