Link to home
Start Free TrialLog in
Avatar of swaggerking
swaggerkingFlag for United States of America

asked on

Dates 5 and 7 days from now

I'm trying to get the dates, 5 and 7 days from now.
Example: Today = 3/19/2013, 5 days = 3/24/2013, 7 days = 3/26/2013

I do not want to count weekends, ie only count business days Mon-Fri.
Example: Today = 3/19/2013, 5 days = 3/26/2013, 7 days = 3/28/2013

Working in classic asp
<% 
Dim strToday, strFive, strSeven
strToday = Date()
strFive = Date() + 5
strSeven = Date() + 7
%>

Today: <%=strToday %><br />
5 Days: <%=strFive %><br />
7 Days: <%=strSeven %>

Open in new window

Avatar of Big Monty
Big Monty
Flag of United States of America image

use the DateAdd function:

<% 
Dim strToday, strFive, strSeven
strToday = now
strFive = DateAdd( "d", 5, strToday )
strSeven = DateAdd( "d", 7, strToday )
%>

Today: <%=strToday %><br />
5 Days: <%=strFive %><br />
7 Days: <%=strSeven %>

Open in new window

Avatar of swaggerking

ASKER

Big Monty,
This still counts weekends. I only want it to count business days.
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No problem, I do it all the time.  This works, but only if the date (strToday) doesn't land on a weekend.

ie. if strToday = 3/22/2013 (weekend) then strFive and strSeven = 3/22/2013 as well.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. I appreciate your help.
my pleasure! happy coding :)