C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Get First and Last day of Week from Date


Posted Date: 07 May 2007    Resource Type: Code Snippets    Category: Date & Time

Posted By: Kamal       Member Level: Gold
Rating:     Points: 10



Find the start (first) and end (last) day of week from the given date.



 
'Enter any Date in MDY format

Dim dtNow As DateTime = Date.Parse("03/24/2007")

Dim nowdayofweek As Integer = dtNow.DayOfWeek

Dim weekStartDate, weekEndDate As DateTime

weekStartDate = DateAdd("d", 0 - dtNow.DayOfWeek, dtNow)

weekEndDate = DateAdd("d", 6 - dtNow.DayOfWeek, dtNow)

'Displays first day of the week

Response.Write(weekStartDate.ToString("MM/dd/yyyy"))

'Displays last day of the week

Response.Write("
" & weekEndDate.ToString("MM/dd/yyyy"))






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Get month name by giving month number
Previous Resource: Find the week for a given date in a month
Return to Discussion Resource Index
Post New Resource
Category: Date & Time


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing

Contact Us    Privacy Policy    Terms Of Use