第一次做这个,唯一的感觉就是累啊没有技术上的难题,只有键盘上的难题。<script language=vbscript>
vyear=year(now())
vmonth=month(now)
vday=day(now)
vhour=hour(now)
vminute=Minute(now)
vsecond=second(now)
if len(vmonth)=1 then vmonth="0" & vmonth
if len(vday)=1 then vday="0" & vday
if len(vhour)=1 then vhour="0" & vhour
if len(vminute)=1 then vminute="0" & vminute
if len(vsecond)=1 then vsecond="0" & vsecond
document.write (vyear & "-" & vmonth & "-" & vday & " " & vhour & ":" & vminute & ":" & vsecond)
</script>
vyear=year(now())
vmonth=month(now)
vday=day(now)
vhour=hour(now)
vminute=Minute(now)
vsecond=second(now)
if len(vmonth)=1 then vmonth="0" & vmonth
if len(vday)=1 then vday="0" & vday
if len(vhour)=1 then vhour="0" & vhour
if len(vminute)=1 then vminute="0" & vminute
if len(vsecond)=1 then vsecond="0" & vsecond
document.write (vyear & "-" & vmonth & "-" & vday & " " & vhour & ":" & vminute & ":" & vsecond)
</script>
<!--
function format(num){
return num>9?num:"0"+num;
}
var date=new Date();
var year= date.getFullYear();
var month= format(date.getMonth()+1);
var day= format(date.getDate());
var hour=format(date.getHours());
var min = format(date.getMinutes());
var sec = format(date.getSeconds());
var curTime=year+"-"+month+"-"+day+" "+hour+":"+min+":"+sec;
alert(curTime);
//-->
</script>