Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by LanX (Saint)
on Oct 12, 2017 at 13:02 UTC ( [id://1201211]=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

Thanks for ignoring my question (again)

Simplified:

  • Which week did 1. of October (Sunday) and 2. belong to?
  • What if the 1. was a Wednesday?
  • Are you aware that most months don't start on Mondays?
update
  • Are you aware that most months have more than 28 (= 7*4) days?

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

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

Replies are listed 'Best First'.
Re^4: I want to know the current week number of the current month
by Muskovitz (Scribe) on Oct 12, 2017 at 13:49 UTC
    Ok sir. So here it is.

    But I'm puzzled about how do you define week of months?
    Answer: What i am trying to tell here is i need to get the "Week Number of Months" like October Week 1, October Week 2 ... so that i can calculate the weekly total of bills.

    Which week did 1. of October (Sunday) and 2. belong to?
    Answer: I can't clearly understand this sir. I'm sorry.

    What if the 1. was a Wednesday?
    Answer: I don't any have answer for this one yet.

    Are you aware that most months don't start on Mondays?
    Answer: yes sir! I am very aware of that.

    Are you aware that most months have more than 28 (= 7*4) days?
    Answer: yes sir! I am also very aware of that :(

    I already did the Today's Total and Monthly Total and now i am stuck in Weekly Total.
      Which week did 1. of October (Sunday) and 2. belong to?
      Answer: I can't clearly understand this sir. I'm sorry.

      That's a notation I've seen that avoids mucking about with "st", "nd", "th" for the ordinals. "1. of October" means "1st of October" or "first of October". IIRC, it's more common in Europe than the States, but I don't know if it's all of Europe, or just certain areas. I don't know if you're European or not, or whether my regional assumptions about the notation are correct; however, I am guessing you didn't recognize the "." notation for ordinals, and that's what's confusing you. If I've mis-guessed, you'll have to explain exactly what you don't understand.

      The questions were all meant to elicit more thought and more definition of the problem on your part.

      Do you define "October Week 1" as October 1st through 7th, and "October Week 2" as October 8th through 14th, no matter what year it is (so whether October starts on Mon, Tue, Wed,...)? Or is "Week 1" the first week that includes a Thursday in October, and it's "Week 0" if it's Friday October 1st (some other year)? Or if October 1st is a Saturday, is Saturday the only day of "October Week 1" and Sunday is the first day of "October Week 2"? update: Or, if your weeks start on Monday, then shift those cases by a day. (I am not asking exact questions. I am asking to elicit more thought and a more detailed definition./update

      How do you handle potential extra partial week at the end of the month (this year, is the 29th part of "October Week 5", or is it part of "November Week 1" or something else entirely?)

      > Which week did 1. of October (Sunday) and 2. belong to? - Answer: I can't clearly understand this sir. I'm sorry.

      > What if the 1. was a Wednesday? - Answer: I don't any have answer for this one yet.

      You should first clarify this with your boss (or client or teacher), because the code depends on the answer.

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

Re^4: I want to know the current week number of the current month
by Muskovitz (Scribe) on Oct 12, 2017 at 13:19 UTC
    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.
      > 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

Log In?
Username:
Password:

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

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

    No recent polls found