URGENT calculating all dates up until the present

# Thread: URGENT calculating all dates up until the present

1. Senior Member
Join Date
Dec 1969
Posts
538

## URGENT calculating all dates up until the present

is there a code snippet around that would generate all days,months within the present year upto the present day.i.e any day past today -13/12/2000 or the States 12/13/2000 starting from a specified day e.g 1999 ...<BR>wouldbe most grateful...Thank you

2. Senior Member
Join Date
Dec 1969
Posts
538

## RE: URGENT calculating all dates up until the pres

A little clarification- the script needs to display drop down menus based on the day,month and year seperately i.e a drop down menu the days,months and year 1999 and 2000<BR>sorry

3. Steve Cimino Guest

## RE: URGENT calculating all dates up until the pres

http://javascript.internet.com<BR><BR>I was there yesterday, and I think there are several dozen code snippets of what you&#039re trying to do.<BR><BR>(The one I looked at told me how many days, hours, minutes, and seconds I&#039ve been alive based on my birthday)

4. Senior Member
Join Date
Dec 1969
Posts
538

## RE: day answered now I need month fix

Alright got the day now any suggestions for month<BR> &#060;select Name="endday" class=formfield&#062;<BR> &#060;%<BR> varDisplayDate = 1<BR> varTodayDate = day(now())<BR> Do While varDisplayDate &#060;= varTodayDate%&#062;<BR> &#060;OPTION VALUE=&#060;%=varDisplayDate%&#062;&#062; &#060;%=varDisplayDate%&#062;&#060;/OPTION&#062;<BR> &#060;%varDisplayDate = varDisplayDate + 1<BR> Loop<BR> <BR> %&#062;<BR> <BR> <BR><BR> &#060;/select&#062;<BR>the month is showing the numeric value rather than the name of the month<BR> &#060;select Name="endmonth" class=formfield&#062;<BR> &#060;%<BR> varDisplayDateMonth = 1<BR> varTodayDateMonth = Month(now())<BR> Do While varDisplayDateMonth &#060;= varTodayDateMonth<BR> <BR> %&#062;<BR> &#060;OPTION VALUE=&#060;%=varDisplayDateMonth%&#062;&#062; &#060;%=varTodayDateMonth%&#062;&#060;/OPTION&#062;<BR> &#060;%varDisplayDateMonth = varDisplayDateMonth + 1<BR> Loop<BR> %&#062;<BR> &#060;/select&#062;<BR>

5. Steve Cimino Guest

## RE: day answered now I need month fix

Do something with an array.<BR><BR>monthArray = Array("January", "February", ... "December") &#039 array of 0 - 11<BR><BR>Now, since the Month() function returns the current month based on 0 - 11, do something like this:<BR><BR>myMonth = monthArray(Month(now))<BR><BR>Now you have the month&#039s name.

6. Senior Member
Join Date
Dec 1969
Posts
538

## RE: day answered now I need month fix

yeah but wouldnt that only show the actual month rather than all the months leading to that day

7. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## MY methodology.............KISS

monthname(month(now()))

8. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Help me out here

are you saying you want all the months leading to today WITHOUT a loop??<BR><BR><BR>or am i holding the wrong end of the stick

9. SC
Senior Member
Join Date
Dec 1969
Posts
125

## RE: MY methodology.............KISS

Yet another function I wasn&#039t aware of. I don&#039t do too much with dates, as you can see...<BR><BR>Perhaps it&#039s that time I should just peruse through the manual for unknown functions.

10. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Obviously.....

you are a happily married man...you should NOT "do" anything with your "dates"...as a matter of fact you should not even go on them :)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•