發新話題
打印

日期及時間顯示

日期及時間顯示

 

 

 

 

全部不需更改,複製貼上便可

 

 

 

 

 

<script language="JavaScript">
<!--
Stamp = new Date();
document.write('<font size="2" face="Arial,Geneva,Sans Serif"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '</B></font><BR>');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " PM";
}
else {
Time = " AM";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write('<font size="2" face="Arial,Geneva,Sans Serif"><B>' + Hours + ":" + Mins + Time + '</B></font>');
// -->
</script>
 

 

 

 

此論壇不能顯示語法效果可貼去本站語法測試板試看

我唔係人.........

TOP

複製上列語法



我唔係人.........

TOP