Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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]
[GotToBTru]: time for some C8H10N4O2 for me
[ambrus]: GotToBTru: wait, you tell only the atom totals of what you want? Is that like ordering food in a restaurant by telling only the nutrient amounts you need, or
[ambrus]: like when a medieval scientist supposedly proves his priority inventing something by having previously published an anagram of a thousand letters long summary of the invention?
[choroba]: Progress! Nowadays, you can write a Perl script to generate such an anagram!

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2016-12-06 13:04 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (104 votes). Check out past polls.