在Adobe Dreamweaver CS3中怎么添加时间,让他显示当前时间
答案:1 悬赏:30 手机版
解决时间 2021-04-22 08:55
- 提问者网友:欺烟
- 2021-04-21 21:50
在Adobe Dreamweaver CS3中怎么添加时间,让他显示当前时间
最佳答案
- 五星知识达人网友:胯下狙击手
- 2021-04-21 22:31
<script LANGUAGE="JavaScript">
<!-- Begin
Stamp = new Date();
document.write((Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear()+ " ");
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write(Hours + ":" + Mins + Time);
// End
// --></script>
<!-- Begin
Stamp = new Date();
document.write((Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear()+ " ");
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write(Hours + ":" + Mins + Time);
// End
// --></script>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯