JS显示时间
来源:互联网 发布:数据挖掘看什么书 编辑:程序博客网 时间:2024/05/01 17:55
<pre name="code" class="html"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script language="javascript">function disptime(){var now = new Date(); //创建一个表示当前日期和时间的对象nowvar hour = now.getHours(); //获取当前时间的小时数if(hour>=0 && hour<=12){document.write("<h2>上午好!</h2>");}if(hour >12 && hour <=18){document.write("<h2>下午好!</h2>");}if(hour>18 && hour <24){document.write("<h2>晚上好!</h2>");}document.write("<h2>今天日期:"+now.getFullYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日</h2>");//由于now.getMonth()方法返回的月份数是0~11,为了与中国的1~12月相对应,所以加1(返回星期几的方法getDay()也是如此)document.write("<h2>现在时间:"+now.getHours()+"点"+now.getMinutes()+"分</h2>");}</script></head><body onload="disptime()"></body></html>
0 0
- 显示时间js
- 时间显示js
- js显示时间
- JS显示动态时间
- js动态显示时间
- js显示时间
- js 状态栏显示时间
- JS时间显示
- JS显示时间
- js时间显示
- js 动态显示时间
- js 简单时间显示
- js显示动态时间
- JS显示时间
- js -显示时间
- js显示当前时间
- JS实时显示时间
- js显示时间
- LeetCode 题解(231) : Valid Sudoku
- 伪静态URLRewrite学习笔记
- python gflags
- 不能将值 NULL 插入列 'ID',表 列不允许有 Null 值.
- nginx + passenger 出现 Cannot stat .../config.ru': Permission denied 的错误的解决办法
- JS显示时间
- ThinkPHP——RBAC不同用户登录系统显示不同权限
- java web与discuz社区整合(二)
- 【读书笔记:C++ primer plus 第六版 中文版】第17章 输入、输出和文件
- PHP+MySQL开发的10条建议
- Java中Excel的导入导出
- 使用lsnrctl status命令区分动态注册,静态注册
- QMetaObject之invokeMethod说明和使用
- 内存管理单元(MMU)介绍