Given a date, how to find the beginning date and ending date of that week

Discussion in 'C++' started by Matt, Nov 8, 2003.

  1. Matt

    Matt Guest

    Given a date, how to find the beginning date and ending date of that week

    please advise!
     
    Matt, Nov 8, 2003
    #1
    1. Advertising

  2. Re: Given a date, how to find the beginning date and ending dateof that week

    Matt wrote:
    > Given a date, how to find the beginning date and ending date of that week
    >
    > please advise!


    if date is an integer corresponding to time in a linear elapsed way then

    my_linear_time find_beginning_of_week( my_linear_time t )
    {
    return ( t + day_of_week_offset ) % time_elapsed_in_week;
    }
     
    Gianni Mariani, Nov 8, 2003
    #2
    1. Advertising

  3. Matt

    Pete Becker Guest

    Re: Given a date, how to find the beginning date and ending date of thatweek

    Matt wrote:
    >
    > Given a date, how to find the beginning date and ending date of that week
    >


    Figure out what day of the week it is (read about the header <time.h>).
    From there it's easy.

    --

    Pete Becker
    Dinkumware, Ltd. (http://www.dinkumware.com)
     
    Pete Becker, Nov 8, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    642
    Matthew Speed
    Nov 8, 2003
  2. Matt
    Replies:
    3
    Views:
    753
    Richard Heathfield
    Nov 8, 2003
  3. Matt
    Replies:
    11
    Views:
    423
    Aaron Bertrand [MVP]
    Nov 8, 2003
  4. Chuck Remes
    Replies:
    7
    Views:
    232
    Gary Wright
    Feb 9, 2010
  5. James Edward Gray II

    [ANN] Red Dirt RubyConf CFP Ending in One Week

    James Edward Gray II, Feb 21, 2010, in forum: Ruby
    Replies:
    0
    Views:
    100
    James Edward Gray II
    Feb 21, 2010
Loading...

Share This Page