DEVELOP > c-Plus-Plus > Given a date, how to find the beginning date and ending date of that week
| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Matt" |
| Date: |
08 Nov 2003 02:01:10 PM |
| Object: |
Given a date, how to find the beginning date and ending date of that week |
Given a date, how to find the beginning date and ending date of that week
please advise!
.
|
|
| User: "Pete Becker" |
|
| Title: Re: Given a date, how to find the beginning date and ending date of thatweek |
08 Nov 2003 02:30:36 PM |
|
|
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)
.
|
|
|
|
| User: "Gianni Mariani" |
|
| Title: Re: Given a date, how to find the beginning date and ending dateof that week |
08 Nov 2003 02:24:43 PM |
|
|
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;
}
.
|
|
|
|

|
Related Articles |
|
|