-
December 18th, 2007, 12:37 PM
#1
date of week in month
Dear all
what's c++ function name is can use to know the
date of week in month
for example
today is 2007-12-19
this the day = 19 in this month is 3 weeks pass in this month
how if the day = 25 is next week in this month .
my question is does any idea i can use code to calculate which day of week in each month?
thank's
-
December 18th, 2007, 03:03 PM
#2
Re: date of week in month
Are you asking which week of the month a specific day is in? For example, 2007-12-19 is in the 3rd week and 2007-12-25 is in the 4th week?
If you could clarify the question you may get more replies.
-
December 18th, 2007, 05:04 PM
#3
Re: date of week in month
There is no such C++ function. You have to compute that by yourself.
-
December 19th, 2007, 04:56 AM
#4
Re: date of week in month
Hello,
As Cilu said, there is no ready-made C function to compute this. Moreover, week has different conventions in different countries and contexts like starting from Sunday, Monday or Saturday. One has to do the computation according to one's needs.
Easiest method is to find the day from the date variable and divide the difference by 7 to get the week. One can refine the computation by checking which is the weekday of first of that month and which is the weekday on which the week starts.
Regards,
Pravin.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|