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 (permalink)  
Old 08-16-2007, 11:13 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo 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#
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-16-2007, 11: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 On
Pingbacks are On
Refbacks are On


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 09: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 09: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 05: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 11:02 PM
How to convert a date to a globally accepted date format, in DOT NET 2005? Archer C# Programming 1 07-25-2007 03:21 AM


All times are GMT -7. The time now is 12:00 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0