Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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";
We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
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"

    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2022-01-21 09:07 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (57 votes). Check out past polls.