Hello guys
i am struggling to get the current week of the month. anybody knows how to get the current week of the current month?
i.e a month has 4-5 weeks i need the current week number of the month
Hello guys
i am struggling to get the current week of the month. anybody knows how to get the current week of the current month?
i.e a month has 4-5 weeks i need the current week number of the month
Well this is a non-question because how do you identify the weeks without code? If a month starts on Tuesday, is that week 1? Is it week zero? Do you count from Sundays? Mondays? Is a week 7 days or is a week Monday-Sunday?
hmm then i ll go check fro javascript for this i guess
No, you haven’t thought about the question - work out, in non-code words, how you work out the week of the month.
Yeah, how are you defining weeks?
If it’s just based on the number of days (i.e. week 1 is 1st - 7th, week 2 is 8th - 14th etc.) then just divide the date by 7, and round up to the nearest integer (ceiling).
i.e.
Current date/time: extract date / 7 :ceiling
If that’s not what you mean by ‘Current Week of the month’, then what do you mean?
It’s pretty easy to get the current week even if a week starts on Sunday (or any specific day) but it seems like you don’t know what you want?
This topic was automatically closed after 70 days. New replies are no longer allowed.