Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: First day of week


Message #1 by "Dennis J. Laney" <laneyden@s...> on Wed, 13 Mar 2002 20:16:36
How do I get the first weekday of a given date.  I want to know if it 

would be mon, tues, etc....



Any ideas?





dl
Message #2 by "Worth, Gib" <Gib.Worth@v...> on Wed, 13 Mar 2002 13:48:33 -0700
<%

dim arDate(7), x, stDate

	dayofweek = weekday(now())

	stDate = FormatDateTime(DateAdd("d", (dayofweek-1) * -1, now()),2)

	for x = 1 to 7

		arDate(x) = FormatDateTime(DateAdd("d", x-1, stDate),2)

	next



%>



This sets up an array of the week (Sun thru Sat).  Should get you started...



-----Original Message-----

From: Dennis J. Laney [mailto:laneyden@s...] 

Sent: Wednesday, March 13, 2002 2:17 PM

To: ASPToday Discuss

Subject: [asptoday_discuss] First day of week



How do I get the first weekday of a given date.  I want to know if it 

would be mon, tues, etc....



Any ideas?





dl

Message #3 by "Max Campsell" <pamax@i...> on Fri, 15 Mar 2002 04:33:23 +1000
Try this,

Using System.Globalization;

CultureInfo ci = CultureInfo.CurrentCulture;
DateTimeFormatInfo dtf ci.DateTimeFormat;

int fd = (int)dtf.FirstDayOfWeek;

regards Max

-----Original Message-----
From: Dennis J. Laney [mailto:laneyden@s...] 
Sent: Wednesday, 13 March 2002 8:17 PM
To: ASPToday Discuss
Subject: [asptoday_discuss] First day of week

How do I get the first weekday of a given date.  I want to know if it 
would be mon, tues, etc....

Any ideas?


dl




  Return to Index