JS获取当前时间显示“上午”、“下午”
最后效果如:下午 4:44:20 这样的格式,并且时间的秒数是变化的
陈道明女儿陈格自杀
这个网页特效代码如下
<html>
< head>
经典的单机游戏
< meta http-equiv="Content-Type" content="text/html; charset=gb2312">
< title>JS获取当前时间,显示“上午”、“下午”丨芯晴网页特效丨CsrCode.Cn</title>
< /head>
< body onload="startclock()">
< script language=JavaScript>
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
function startclock () {
stopclock();
showtime();}
function showtime () {
var now = new Date();
var hours = Hours();
var minutes = Minutes();
var seconds = Seconds()
成人高考的学历有用吗var timeValue = "" +((hours >= 12) ? "下午 " : "上午 " )
2pm成员
timeValue += ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
document.clock.thetime.value = timeValue;
timerID = setTimeout("showtime()",1000);金希澈 我们结婚了
timerRunning = true;}
< /SCRIPT>
< form name=clock >
< input name=thetime size=12>
兰州美食< /form>
< /body>
< /html>