JS获取时间显示上午,下午
来源:互联网 发布:链家端口费 编辑:程序博客网 时间:2024/06/09 21:46
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>时间显示 站长学院 www.pigzz.com</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 = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" +((hours >= 12) ? "下午 " : "上午 " )
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 style="font-size: 9pt;color:#000000;border:0" size=12>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>时间显示 站长学院 www.pigzz.com</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 = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" +((hours >= 12) ? "下午 " : "上午 " )
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 style="font-size: 9pt;color:#000000;border:0" size=12>
</form>
</body>
</html>
- JS获取时间显示上午,下午
- 如何去除时间显示里的上午和下午
- android 获取时间 判断是上午的还是下午
- 时间操作(JavaScript版)—页面显示格式:年月日 上午下午 时分秒 星期
- 根据当前时间不同在jsp业上显示上午,下午
- oracle 中处理 时间 显示为 年 月 日 下午/上午 时 分 秒
- Qt 检测时间是上午还是下午
- 获取系统时间,判断是时间段(早上,上午,中午,下午,晚上)
- JAVA判断当前时间是上午am还是下午pm
- Java中判断当前时间为上午,下午
- JAVA判断当前时间是上午am还是下午pm
- 关于iis 时间格式 带星期、上午、下午的问题
- Java中判断当前时间为上午,下午
- weui 时间控件含全天 上午 下午 选择
- DateTime.Now.ToString("yyyy-MM-dd") 怎样显示上午/下午
- 老是显示12小时制,总是出现上午、下午。
- js判断早上好,上午好,下午好,傍晚好,晚上好
- js获取当前时间显示
- 详解JDBC与Hibernate区别
- fcntl()函数的用法
- Common Tasks :Connecting to a Host
- oracle用户解锁的三种方式
- Highcharts纯Javascript图表使用讲解(附Demo全源码案例)
- JS获取时间显示上午,下午
- 与moment.js整合使用的javascript日期选择期 - Pikaday
- C++头文件
- poj2250 Compromise dp lcs 记录路径
- 大平台的局限
- C++11(及现代C++风格)和快速迭代式开发
- 项目中软件架构过程
- 为Android系统安装BusyBox
- .NET Remoting程序开发入门篇