in reply to Re^3: 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

Yes sir! that is why i posted here to seek for help.
my goal is to sum up all the weekly total of bills. So that is why i need to know if it is the 1st/2nd/3rd week of the current month.
If you have any tips/tricks on how to this kind of stuff sir. Please i need it.

Anyways thanks for your replies. I really really appreciate it.
  • Comment on Re^4: I want to know the current week number of the current month

Replies are listed 'Best First'.
Re^5: I want to know the current week number of the current month
by LanX (Saint) on Oct 12, 2017 at 13:25 UTC
    > If you have any tips/tricks on how to this kind of stuff sir.

    Sure, just answer my questions.

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

      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

        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

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

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