|
CodeAve.com - ASP - Read/Write | |||
|
||||
| Date Dependent Content | ||||
|
|
||||
<% ' The following for next loop is used to demonstrate ' how this code will work on three different dates ' The varible the_date should be set to date() to retrieve ' the current date when implemented for count = 1 to 3 if count = 1 then the_date=#12/30/1999# end if if count = 2 then the_date=#12/31/1999# end if if count = 3 then the_date=#01/01/2000# end if start_date= #12/31/1999# expiration_date = #01/01/2000# %> <%= "Start Date=" & start_date &" End Date=" & expiration_date & " Today=" & the_date %> <br> <% if start_date <= the_date then %> <% if expiration_date - the_date <= 0 then %> Content has expired <u>on</u> <%= expiration_date %> <% else %> Content will appear <u>for</u> <%= expiration_date - the_date %> more day(s) <% end if %> <% else %> Content will appear <u>in</u> <%= abs(the_date - start_date) %> more day(s) <% end if %> <p> </p> <% next %>
|
||||
|
|
||||