Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Months of the year

by kennethk (Abbot)
on Mar 31, 2014 at 19:02 UTC ( #1080431=note: print w/replies, xml ) Need Help??

in reply to Months of the year

The line from the docs
Means that if you want to change the months list (for perhaps localization or internationalization), this is the API. If you just call the method with no arguments, you get the list of months:
my @months = Time::Piece::mon_list;
my $t = Time::Piece->new(); my @months = $t->mon_list;

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Months of the year
by Anonymous Monk on Mar 31, 2014 at 19:14 UTC
    Thats a lot less code, now is trying to get the full name of the months with:
    my @months = $t->fullmonth;
    Not that easy I guess. It only gives the full name of the current month.
      use Time::Piece; use feature 'say'; my $t = Time::Piece->strptime('1', '%m'); for ( 0..11 ) { say $t->add_months($_)->fullmonth }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1080431]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2018-03-24 16:37 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.