Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by thanos1983 (Parson)
on Oct 12, 2017 at 16:15 UTC ( [id://1201240]=note: print w/replies, xml ) Need Help??


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

Hello again Muskovitz.

Do check my latest update (update3) bellow.

From my point of view if you want to calculate correctly the number of weeks is 3. Because this month started on Sunday (1s of October). Which means the second week was 2nd day of the month. So since we are in the 12th of October currently it makes sense to be the third week, if you calculating the weeks as they start on Monday.

So at this point it depends on what you want to consider a week. Do you count weeks e.g. if the date is 12th then only two weeks have passed this month what if the month has 31 days and the month started on Sunday as on this case then we have 6 weeks in total if you count the beginning of a week on Monday.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

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

    No recent polls found