IT Community - Software Programming, Web Development and Technical Support

How to find the Starting date of week from a particular date

This is a discussion on How to find the Starting date of week from a particular date within the C# Programming forums, part of the Software Development category; hi How to find the Starting date of week from a particular date if i give particular date example:"...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 08-16-2007, 10:13 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 881
kingmaker is on a distinguished road
Send a message via MSN to kingmaker
Question How to find the Starting date of week from a particular date

hi
How to find the Starting date of week from a particular date

if i give particular date example:"15-07-2007"

how can i get the starting date of this week as '12-07-2007'
using c#
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 08-16-2007, 10:25 PM
smani smani is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 56
smani is on a distinguished road
Default Re: How to find the Starting date of week from a particular date

hi,
try this.

DateTime dateshow = Convert.ToDateTime("08/15/2007");
int count = Convert.ToInt32(dateshow.DayOfWeek);
int startdifference = dateshow.DayOfYear - count;
string year = dateshow.Year.ToString();
DateTime yearstart = Convert.ToDateTime("01/01/" + year);
DateTime startDate = yearstart.AddDays(startdifference );


Regards
Manivannan.s
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a date in milliseconds back to a date string itbarota HTML, CSS and Javascript Coding Techniques 2 03-03-2008 08:03 PM
How can I find the day of the week for a given date. itbarota HTML, CSS and Javascript Coding Techniques 2 02-01-2008 08:36 PM
How can I show the documents last modified date in the format: month, date, year, tim Pvinothkumar HTML, CSS and Javascript Coding Techniques 3 12-28-2007 04:58 AM
How can I compare a date in a string with todays date? itbarota HTML, CSS and Javascript Coding Techniques 2 12-18-2007 10:02 PM
How to convert a date to a globally accepted date format, in DOT NET 2005? Archer C# Programming 1 07-25-2007 02:21 AM


All times are GMT -7. The time now is 02:41 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0