js格式化时间
来源:互联网 发布:矩阵乘法优化 编辑:程序博客网 时间:2024/06/05 16:10
Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt;}
var date=new Date();
alert('timerNow:'+ date.Format("yyyy-MM-dd hh:mm:ss"));
0 0
- 【js】js时间格式化
- js中格式化时间
- js时间日期格式化
- js 格式化时间
- js 格式化时间函数
- js格式化时间
- js 格式化时间
- js时间格式化
- js中格式化时间
- js 格式化时间
- js的时间格式化
- js 时间格式化
- js格式化时间
- js时间格式化
- js字符串格式化时间
- js 时间格式化
- 用js格式化时间
- js 时间格式化
- Matrix-Tree定理
- java 10位和13时间戳转日期格式
- 第一个比较完整的但是乱七八糟的网页
- vue-cli整合vuex的时候,修改actions和mutations,实现热部署
- 彻底清除session
- js格式化时间
- 使用Eureka将Node.js引入Spring Cloud
- linux c .c文件编译 基本语法
- jenkins2.36版war包
- navicat快捷键
- java通过axis2调用SAP接口
- kafka文档(13)----0.10.1-Document-文档(5)-configures-consumer配置信息
- easyui自适应常见问题解决方法
- litepal出错 multiple dex files define