Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: ISO 8601 week number

by jasonk (Parson)
on Sep 20, 2008 at 02:13 UTC ( #712678=note: print w/ replies, xml ) Need Help??


in reply to ISO 8601 week number

Or the really easy way...

use DateTime; print DateTime->now->week_number,"\n";

www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!


Comment on Re: ISO 8601 week number
Download Code
Re^2: ISO 8601 week number
by wol (Hermit) on Sep 21, 2008 at 11:14 UTC
    I'll vote for that.

    Sigh. I don't know how long I looked for a simple solution before I gave up and wrote one, but somehow I never saw the DateTime option. Still, I think it's worth publishing the algorithm, even if it's only a benefit for people who need to implement it in something other than perl...

    I might simplify some code next week.

    PS - I wonder why I can see the module on CPAN, but not via PPM in any of Active's repositories

Re^2: ISO 8601 week number
by larryk (Friar) on Mar 28, 2014 at 11:15 UTC
    And nowadays the same thing with a core module

    perl -MTime::Piece -e "print localtime->week"

       larryk                                          
    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-09-16 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (155 votes), past polls