Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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
Time::Piece::mon_list(@months);
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;
or
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1080431]
help
Chatterbox?
[robby_dobby]: blogs.perl.org page for yapceu is out of date by 2 years
[robby_dobby]: LanX: Sharm-el-Sheikh is in Egypt
[choroba]: act.yapc.eu
[robby_dobby]: Thanks, choroba
[LanX]: yes and Egypt (like Turkey and Russia) belongs to two continents
[choroba]: Also Europe and Asia are geographically one continent, the division is political
[robby_dobby]: I always thought everything on the other side of Suez to be Africa. That's an entire continent
[LanX]: Sinai_Peninsula
[robby_dobby]: choroba: If you're talking of Eurasia, it's only true of the erstwhile Constantinople/ Ottoman empire
[LanX]: yes correct, but Sinai is not on the other side

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (15)
As of 2017-04-24 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.