Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: ISO 8601 week number

by jasonk (Parson)
on Sep 20, 2008 at 02:13 UTC ( [id://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!

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"

       larryk                                          
    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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found