Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: I want to know the current week number of the current month

by syphilis (Archbishop)
on Oct 13, 2017 at 12:34 UTC ( [id://1201310]=note: print w/replies, xml ) Need Help??


in reply to Re^5: I want to know the current week number of the current month
in thread I want to know the current week number of the current month

Sure, just answer my questions

It's just a matter of understanding the definition of the words:
The first week of the month is (by definition) that period from the 1st to the 7th (inclusive).
The second week of the month is (by definition) that period from the 8th to the 14th (inclusive).
The third week of the month is (by definition) that period from the 15th to the 21st (inclusive).
The fourth week of the month is (by definition) that period from the 22nd to the 28th (inclusive).
After that, you're in the fifth week of the month until the next month comes around.

Cheers,
Rob
  • Comment on Re^6: I want to know the current week number of the current month

Replies are listed 'Best First'.
Re^7: I want to know the current week number of the current month
by ww (Archbishop) on Oct 13, 2017 at 13:56 UTC

    Quibble: your definition of "weeks of months" is one legitimate possibility.

    BUT my US-ian orientation is accustomed to the notion that "weeks" begin either with a Sunday or Monday, NOT with day one of a month. And for OP's purposes (inferred, perhaps incorrectly) the desired weeks may actually be "work weeks," Mon-Fri.

    Re work-week day 0, as Wikipedia tells us (at https://en.wikipedia.org/wiki/ISO_week_date ) "in some Muslim countries, the normal work week begins on Saturday, while in Israel it begins on Sunday."

    CPAN finds a number of modules (sorry: not checked as I'm short of time!) using "cpan iso week" as the search string. These include Date::ISO, Date::ICal, Date::ISO8601 and DateTime::Format::ISO8061. One or more may be helpful.


    ++$anecdote ne $data

Re^7: I want to know the current week number of the current month
by LanX (Saint) on Oct 13, 2017 at 13:16 UTC
    You are free to code it, if it's so obvious. ;)

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      You are free to code it, if it's so obvious. ;)

      Which (I hope) means that I am also free to not code ... even though it is so obvious ;-)

      Cheers,
      Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-23 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found