实时显示当前时间(英文版)
前言:实时显示当前时间(英文版),一周的第几天用英文显示
效果:
<!DOCTYPE html>
<html lang="zh"><head><meta charset="UTF-8" /><title>Document</title></head><body><div id="box"></div><script src='jquery.min.js'></script><script>function formatDate() {now = new Date();var year = now.getFullYear(),month = now.getMonth() + 1,date = now.getDate(),day = now.getDay(),hour = now.getHours(),minute = now.getMinutes(),second = now.getSeconds();minute = checkTime(minute);month = checkTime(month);date = checkTime(date);hour = checkTime(hour);second = checkTime(second);day = checkday(day)return year + " / " + month + " / " + date + " "+ day +" " + hour + ":" + minute + ":" + second;}function checkTime(i) {if(i < 10) {i = "0" + i}return i}function checkday(daynum){switch (daynum){case 0:daynum=' Monday 'break;case 1:daynum=' Tuesday 'break;case 2:daynum=' Wednesday 'break;case 3:daynum=' Thursday 'break;case 4:daynum=' Friday 'break;case 5:daynum=' Saturday 'break;case 6:daynum=' Sunday 'break;default:break;}return daynum}showtime();function showtime(){var gettime = formatDate();$("#box").text(gettime);}setInterval(function(){showtime();//封装的显示时间的方法},1000);</script></body></html>
实时显示当前时间(英文版)相关推荐
- 【响应式Web前端设计】在html页面实时显示系统时间
在html页面实时显示系统时间 桌面新建记事本,将下列代码复制粘贴,重命名后缀为.html,保存,用浏览器打开即可 <html> <head><meta http-equ ...
- 实时显示当前时间(中文版)
前言:实时显示当前时间(中文版),一周的第几天用中文显示 效果: <!DOCTYPE html> <html lang="zh"><head>& ...
- 实时显示当前时间,每秒更新
实时显示当前时间,每秒更新 我们可以利用定时器来完成这个功能 HTML <div id="app">{{date}} </div> JS <scrip ...
- 在html页面实时显示系统时间
在html页面实时显示系统时间 桌面新建记事本,将下列代码复制粘贴,重命名后缀为.html,保存,用浏览器打开即可 <html> <head><meta http-equ ...
- 【Unity】在Unity中实时显示北京时间
感觉在网上搜到的大部分Unity或者C#获取北京时间的方法都已经不提供服务了,搜到一个可用的稍微拓展下做成了实时显示北京时间的脚本. 但因为只在程序启动的时候有获取北京时间,接下来显示的时间都是每秒钟 ...
- 使用js实时显示北京时间
今天由于项目需要,需要在网站首页显示实时的北京时间, 在网上扒了一会儿,感觉没看明白怎么回事儿,最后还是从别的网站上copy来的,所以这次不是原创啊.哈哈 1.首页引入jquery.min.js 2. ...
- 使用定时器编程,在实时显示当前时间,每隔2秒时钟内容更新一次
编写一个java application应用程序,使用定时器编程,在实时显示当前时间,每隔2秒时钟内容更新一次. 定时器Timer类 程序代码: 运行结果: 定时器Timer类 Timer是一种定时器 ...
- html+显示在线时间,在html页面实时显示系统时间
原创散场前的温柔 最后发布于2018-11-05 13:24:58 阅读数 16005 收藏 展开 在html页面实时显示系统时间 桌面新建记事本,将下列代码复制粘贴,重命名后缀为.html,保存, ...
- JavaScript实时显示日期时间
网页里实时显示当前时间 <html><head><title>显示系统日期时间</title><script language="Jav ...
最新文章
- 交换机调试工具_工业以太网交换机安装流程图解
- TreeMap实现权重随机数Java
- 论文浅尝 - KDD2020 | 真实世界超图的结构模式和生成模型
- Java 面试 80% 的人都会踩这些坑,你知道几种?
- php下xmlwriter,PHP实现基于XMLWriter操作xml的方法
- brew mysql要多久_mac brew 安装 mysql
- linux7启动ib子网管理器,IB_Switch交换机SB7890配置及Band网卡
- Maxscript-通用事件反馈
- Pentaho Report Designer
- iOS 苹果自带地图需求开发——1
- java语言就业方向_java就业有哪些方向
- 友盟APM和bugly全面对比
- Windows下使用ffmpeg录屏和录音
- 读书笔记-Office 365开发入门指南
- java-net-php-python-ssh学生信息管理系统录像演示录像2019计算机毕业设计程序
- Exchange2016 Skype for business 集成之一配置合作伙伴应用程序
- 基于jQuery的软键盘
- 有照片换发型的软件吗?看完这篇文章就知道了
- 谷歌浏览器 Doc 简介--Documents
- 全国计算机设计水平大赛,喜报|“全国计算机设计大赛”又被传媒学子斩获大奖!...