Date Question

A

AGB

Hi all,

I need a script that tells the user what the date is for monday and
what the date is for friday for the current week based on the current
day.

Any help?
 
A

Aaron Bertrand [SQL Server MVP]

Given a "standard" datefirst setting, e.g. Sunday = 1, Monday = 2, you can
try this:

<%
dt = date()

dw = datepart("w", dt)
response.write "Monday = " & (dt + (2-dw))
response.write "<br>"
response.write "Friday = " & (dt + (6-dw))
%>

Might make more sense to have a calendar table though.
http://www.aspfaq.com/2519
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top