试编写一个简单的ASP程序显示当时系统的日期和时间

来源:百度知道 编辑:UC知道 时间:2024/06/30 04:29:51
详细过程

<%
function a(b)
a=b
if b<>"" then
a=replace(a,"上午","")
a=replace(a,"下午","")
a=replace(a,"/","-")'这裏可以根据实际需要来变动
end if
end function
response.write a(now())
%>

用到一段小的JS代码 绝对能用刚刚实验过
显示当前时间:

<script language="javascript">
function showtime()
{
var today,year,month,hour,minute,second;
today=new Date();
year=today.getYear();
month=today.getMonth()+1;
date=today.getDate();
hour=today.getHours();
minute=today.getMinutes();
second=today.getSeconds();
document.getElementById('time').innerHTML=year+"年"+month+"月"+date+"日"+hour+"时"+minute+"分"+second+"秒";
setTimeout("showtime();",1000)
}
</script>
<p>当前时间:<span id="time">