CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 4 of 4

Thread: date of week in month

  1. #1
    Join Date
    Dec 2005

    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?


  2. #2
    Join Date
    May 2002

    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.

  3. #3
    Join Date
    Oct 2002
    Timisoara, Romania

    Re: date of week in month

    There is no such C++ function. You have to compute that by yourself.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Feb 2000
    Indore, India

    Re: date of week in month


    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.

    Let me know if I have helped by rating this post

    Recent FAQs

    Drag an image
    Area of a window exposed on desktop
    Display rotated bitmap

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)