代码如下:
<%@ Language=VBScript %><%Response.Expires =0 %> <DOCTYPE html public='-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=gb2312"> </META> <TITLE>测试毫秒_www.jb200.com</TITLE> </HEAD> <BODY> <SCRIPT RUNAT="SERVER" LANGUAGE="JSCRIPT"> var d = new Date(); Session("ms") = d.getMilliseconds(); Response.Write(Session("ms")) </SCRIPT> <BR> <%=Session("ms")%> </BODY> </HTML> 得到17位的当前时间 如:20091210105237238=2009年12月10日10:52:37:238 <SCRIPT RUNAT="SERVER" LANGUAGE="JSCRIPT"> var d = new Date(); Session("ms") = d.getMilliseconds(); </SCRIPT> <% '年月日20090101格式 id=year(now())&right(month(now())+100,2)&right(day(now())+100,2) '时间010101格式 id=id&right(replace(time(),":","")+1000000,6) '3位数的毫秒 id=id&right(Session("ms")+1000,3) response.Write(id) %>