To realize that text disappears after a specific time in asp, the main method is to use the DateDiff function! DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear]])
// timeinterval represents the type of interval, the code is:
yyyy year
q season
m month
y the number of days in a year
d day
w Day of the week
ww weeks
h time
n minutes
s seconds
Specific examples:
Copy the code code as follows:
<%
d1=DateDiff(d,Now(),cdate(rs(adddate)))//Read the date of product addition from the database
if d1>-15 then
new_text=New style
else
new_text=
end if
%>
//d1 represents the following time minus the previous time
<%=new_text%>