|
-
Oct 10th, 2000, 04:17 AM
#1
Thread Starter
Addicted Member
Hi,
is there any date formatting facility in VBScript? I want to use ASP to return the date from today till 31 days from now to populate a list box. However I want the date as a string i.e. "10 Oct. 2000" etc. so there can be no confusion as to the exact date. The normal VB format functionality doesn't seem to apply. My simple source is below:
<%
'//=========================================================
'// Populate list box with dates for the next 31 days
'//=========================================================
dim day_count
day_count = 0
Response.Write "<SELECT NAME=selListBox>"
do until day_count = 31
Response.Write " <option>" & date() + day_count & "</option>"
day_count = day_count + 1
loop
Response.Write "</SELECT>"
%>
-
Oct 10th, 2000, 05:07 AM
#2
Fanatic Member
Hi lenin
all you need is the formatdatetime function
Code:
<html>
<body>
<%
'//=========================================================
'// Populate list box with dates for the next 31 days
'//=========================================================
dim day_count
day_count = 0
Response.Write "<SELECT NAME=selListBox>"
do until day_count = 31
Response.Write " <option>" & FormatDateTime(date() + day_count,vbLongDate) & "</option>"
day_count = day_count + 1
loop
Response.Write "</SELECT>"
%>
</body>
</html>
Hope this helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Oct 10th, 2000, 05:10 AM
#3
Thread Starter
Addicted Member
That's the ticket.
Many thanks Ian.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|