Get Start Date and End Date of the Week
VB
Thread Starter: Paschal
Started: 12-07-2004 10:39
Replies: 0

Ireland .NET Developer Alliance :: Forums » Technologies » VB » Get Start Date and End Date of the Week
Next Thread »
   07 Dec 2004, 10:39
Paschal is not online. Last active: 11/02/2005 15:00:30 Paschal

Top 10 Posts
Joined on 27-10-2004
Posts 84
Get Start Date and End Date of the Week
'Enter any Date in MDY format
Dim dtNow As DateTime = Date.Parse("04/25/2004")
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"))
  
  Page 1 of 1 (1 items)
Ireland .NET Developer Alliance :: Forums » Technologies » VB » Get Start Date and End Date of the Week

Powered by Community Server :: Forums