|
 |
asp_web_howto thread: Date Stuff
Message #1 by "O'Hara, Elliott M" <EMOHARA@k...> on Thu, 22 Mar 2001 09:44:37 -0500
|
|
AAAAAAAARRRRGH!
How do I get the date for Sunday of this week???
Message #2 by "Craig Flannigan" <ckf@k...> on Thu, 22 Mar 2001 14:58:05 -0000
|
|
This is the code I use to obtain the date of Monday whatever
the date on the server is.
We use this on our Diary system. The Daycode is the bit you
need to alter to reflect the day you want. Running this code
would give you the 19/03/01.
<%
CurrentDay = Weekday(now)
DayCode = (currentday / currentday) + 1
StartDayCode = CurrentDay - DayCode
MondayDate = Dateadd("d", -StartDayCode, now)
Response.write MondayDate
%>
Hope it helps.
-----Original Message-----
From: O'Hara, Elliott M [mailto:EMOHARA@k...]
Sent: 22 March 2001 02:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Date Stuff
AAAAAAAARRRRGH!
How do I get the date for Sunday of this week???
Message #3 by "O'Hara, Elliott M" <EMOHARA@k...> on Thu, 22 Mar 2001 10:01:42 -0500
|
|
okokok
sunday of any week....
I know I can write a function to do it, I was just wondering if there is
something built in that I'm missing...
-----Original Message-----
From: O'Hara, Elliott M [mailto:EMOHARA@k...]
Sent: Thursday, March 22, 2001 9:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Date Stuff
AAAAAAAARRRRGH!
How do I get the date for Sunday of this week???
Message #4 by "Craig Flannigan" <ckf@k...> on Thu, 22 Mar 2001 15:13:02 -0000
|
|
No.
-----Original Message-----
From: O'Hara, Elliott M [mailto:EMOHARA@k...]
Sent: 22 March 2001 03:02 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Date Stuff
okokok
sunday of any week....
I know I can write a function to do it, I was just wondering
if there is
something built in that I'm missing...
-----Original Message-----
From: O'Hara, Elliott M [mailto:EMOHARA@k...]
Sent: Thursday, March 22, 2001 9:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Date Stuff
AAAAAAAARRRRGH!
How do I get the date for Sunday of this week???
Message #5 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 22 Mar 2001 15:07:33 -0000
|
|
Elliott,
do something like this in vbscript
n = 7 - (Weekday(date, 1))
dSunday = DateAdd("d", n, date(now))
-----Original Message-----
From: O'Hara, Elliott M [mailto:EMOHARA@k...]
Sent: Thursday, March 22, 2001 2:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Date Stuff
AAAAAAAARRRRGH!
How do I get the date for Sunday of this week???
Message #6 by "O'Hara, Elliott M" <EMOHARA@k...> on Thu, 22 Mar 2001 10:23:18 -0500
|
|
thanks... worked fine
now I'm trying to figure out why...
???
currentday=5
DayCode=(5/5)' that = 1 'I killed the + 1 because I want Sunday
StartDayCode = 5 - 1 ' thats 4
SundayDate = Dateadd("d",-4,date) ' also used date instead of now because
frankly I don't give a damn what time it is
soo.... SundayDate = 3/22/01 - 4 ' thats hmm.. the 18th...
nice
like it..
thanks
-----Original Message-----
From: Craig Flannigan [mailto:ckf@k...]
Sent: Thursday, March 22, 2001 9:58 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Date Stuff
This is the code I use to obtain the date of Monday whatever
the date on the server is.
We use this on our Diary system. The Daycode is the bit you
need to alter to reflect the day you want. Running this code
would give you the 19/03/01.
<%
CurrentDay = Weekday(now)
DayCode = (currentday / currentday) + 1
StartDayCode = CurrentDay - DayCode
MondayDate = Dateadd("d", -StartDayCode, now)
Response.write MondayDate
%>
Hope it helps.
-----Original Message-----
From: O'Hara, Elliott M [mailto:EMOHARA@k...]
Sent: 22 March 2001 02:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Date Stuff
AAAAAAAARRRRGH!
How do I get the date for Sunday of this week???
---
Message #7 by "Wally Burfine" <oopconsultant@h...> on Thu, 22 Mar 2001 18:50:38 -0000
|
|
Elliott,
Try this:
dateadd("d",(weekday(Date(),vbSunday)-1)*-1,Date())
Regards,
Wally
>From: "O'Hara, Elliott M" <EMOHARA@k...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] Date Stuff
>Date: Thu, 22 Mar 2001 09:44:37 -0500
>
>AAAAAAAARRRRGH!
>
>How do I get the date for Sunday of this week???
>
|
|
 |