codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  dates  Archive Import (diego) at 02:41 on Wednesday, July 09, 2003
 

i just want to ask, i have 2 text boxes, i put the first date in the first box and the second date in the second textbox.How can i get the dates from the two given dates
sample:
1/5/2003 and 1/10/2003
i want to get
1/5/2003
1/6/2003
1/7/2003
1/8/2003
1/9/2003
1/10/2003

pls. help
thanks

  Re: dates  Yusairi at 07:29 on Wednesday, July 09, 2003
 

hello diego,
i`m design on my own and it`ll work with any date you insert
between this 2 textbox.

consider format for 1/5/2003 is mm/dd/yyyy
below are sample from me :

1. create file Date.html

<html>
<body>
<form name=form1 method=post action="/forum/getDate.html">
START
<input type="text" name=text1 value="1/5/2003">
FINISH
<input type="text" name=text2 value="1/10/2003">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>



2. create file getDate.asp

<%
`Contribute from Yusairi
`Subject : View the selected duration date
`feel free to visit http://www.vss.com.my

date1 = CDATE(request.form("text1"))
date2 = CDATE(request.form("text2"))

day1 = day(date1)
mth1 = month(date1)
year1 = year(date1)

day2 = day(date2)
mth2 = month(date2)
year2 = year(date2)

difdate = date2 - date1
maxdate = date1 + difdate

i=0

do while i <= difdate
tempdate = date1 + i
response.write tempdate & "<br>"
i = i + 1
loop

`Finish Code
%>



GOOD LUCK...
Yusairi: site expert
http://www.codetoad.com


  Re: dates  Elain at 07:23 on Wednesday, November 17, 2010
 

A good question and wonderful answer! Thanks for sharing the knowledge with us!
-----------------------------------------
flash banner|logo maker|flash menu|








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: title
•  Re: problem with eval function, please help me!
•  Re: I would like to put a column in an excel spreadsheet that reads +10/-10
•  Re: Common language searching....
•  The Internet in a Box-Widernet Project
•  Re: hi
•  Re: Questions about Bill Gates
•  Re: How to convert a big XML to HTML using XSL?
•  Re: Assign a html table element to a variable


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010