Recommended: Talking about BOF or EOF one is true, or the current record has been deleted When debugging the "Student Management System", if you want to modify the student status information, if the data in the database has been completely deleted at this time, an error will appear: "BoF or Eof is true, or the current record has been deleted." What we need to do at this time is to use the moveNext and other methods of the Recordset object to determine whether the data in the database is used to determine whether the data in the database is used before using the Recordset object's moveNext and other methods.
Display time on the web page. If the time on the user's native machine is taken, the time of the user is often inaccurate, so there is a problem with the display. The server time generally does not have too much error, so it is best to display the server time
The following is an example of asp+js.
The following analyzes the code structure and first obtains the server time:
<%
d=Date()
t=Time()
%>
var t0=new Date().getTime();
var nyear=<%=Year(d)%>;
var nmonth=<%=Month(d)%>;
var nday=<%=Day(d)%>;
var nwday=<%=WeekDay(d)%>-1;
var nhrs=<%=Hour(t)%>;
var nmin=<%=Minute(t)%>;
var nsec=<%=Second(t)%>;
//Get the difference between local time and server time
var dectime=new Date(nyear,nmonth-1,nday,nhrs,nmin,nmin,nsec).getTime()-t0;
nday=-1;
//Span for displaying time
document.write(<span id=clock style=word-break:keep-all></span>);
//Time calculation function:
function NewTick(){
var noww=new Date();
var t1=noww.getTime();
noww.setTime(t1+dectime);
if(noww.getDate()!=nday){
nyear=noww.getFullYear();nmonth=noww.getMonth()+1;nwday=noww.getDay();nday=noww.getDate();
}
nhrs=noww.getHours();nmin=noww.getMinutes();nsec=noww.getSeconds();
}
//Time display function:
function Draw(){
NewTick(); // Calculate first
var s=nyear+'year'+nmonth+'month'+nday+'day'+'weekday'+cweekday(nwday)+' '+shapetime(nhrs,nmin,nsec);
s+= lunar calendar + lmonth + month + lday;//Show lunar calendar
document.getElementById(clock).innerHTML=s;
//Retrieve the local time every 500 milliseconds:
setTimeout(Draw(),500);
}
//Start display:
Draw();
Other questions:
The time obtained by the server cannot be cached locally, so the cache control function must be added to the code;
You must also prevent other websites from stealing your server time code, so you must add anti-theft link function.
If you need to display the lunar calendar, you also need to add the lunar calendar operation function.
Share: Revealing 2 ways to solve the script timeout when ASP runs When running ASP, I encountered a script timeout problem, and the prompt message was: "ActiveServerPages error 'ASP0113 script timeout'". Solution: Modify two places: First: Open IIS-local computer, click on the website, right-click ---Properties-Home Directory-Configuration-Options--ASP script timeout time, which can be changed to 60-90 seconds or higher; Second: % session.