> If you have any tips/tricks on how to this kind of stuff sir.
Sure, just answer my questions.
| [reply] |
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
| [reply] |
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.
| [reply] [d/l] |
You are free to code it, if it's so obvious. ;)
| [reply] |