Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Given a date, how to find the beginning date and ending date of that week

Reply
Thread Tools

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

 
 
Matt
Guest
Posts: n/a
 
      11-08-2003
Given a date, how to find the beginning date and ending date of that week

please advise!
 
Reply With Quote
 
 
 
 
Gianni Mariani
Guest
Posts: n/a
 
      11-08-2003
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;
}

 
Reply With Quote
 
 
 
 
Pete Becker
Guest
Posts: n/a
 
      11-08-2003
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP General 11 11-08-2003 11:24 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C Programming 3 11-08-2003 09:07 PM



Advertisments