Date对象增加format函数
来源:互联网 发布:中国女性受侵害数据 编辑:程序博客网 时间:2024/05/24 06:17
vart = new Date(itemobj.createtime).format("yyyy-MM-dd hh:mm:ss");
Date.prototype.format = function (fmt) { 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;}
阅读全文
0 0
- Date对象增加format函数
- JavaScript中Date对象扩展format函数
- javascript Date Format 函数
- MsAjax Lib-> Date.format 函数
- Date对象中追加format方法
- PHP函数Date()和format参数表
- Date() 时间的一个 format 格式化函数
- Date对象及函数
- 给std::string增加format函数
- 给std::string增加format函数
- Date format
- Date Format
- date format
- date format
- Date Format
- settings/Date&time/Choose date format中增加自己定义的日期格式
- 在mysql中,DATE_FORMAT(date, format) 函数根据format字符串格式化date值。
- JavaScript Date 对象与函数
- VARCHAR2(20)可以存储多少个数字
- MySQL创建全文索引
- iOS XXXXX is not an object file (not allowed in a library)
- Python3爬虫小程序——爬取各类天气信息
- 笔记-CDN
- Date对象增加format函数
- iOS SDK中使用了第三方框架问题
- 实习随手记-win32进程操作
- iOS: 使用KVO监听控制器中数组的变化
- 比特币发明者身价已超百亿 8年暴涨300万倍
- jquery(代码)
- 高性能mysql读书笔记(四)
- 算法复杂度
- Intellij idea破解办法