日期:2014-05-16  浏览次数:20742 次

js 格式化时间日期函数

[代码] [JavaScript]代码

01 /**
02 ?* 时间对象的格式化;
03 ?*/
04 Date.prototype.format = function(format) {
05 ????/*
06 ?????* eg:format="YYYY-MM-dd hh:mm:ss";
07 ?????*/
08 ????var o = {
09 ????????"M+" :this.getMonth() + 1, // month
10 ????????"d+" :this.getDate(), // day
11 ????????"h+" :this.getHours(), // hour
12 ????????"m+" :this.getMinutes(), // minute
13 ????????"s+" :this.getSeconds(), // second
14 ????????"q+" :Math.floor((this
友情链接: 爱易网 云虚拟主机技术 云服务器技术 程序设计技术 开发网站 APP开发教程
Copyright © 2013-2026 爱易网页 当前在线:1232人  网站在21时2分53秒内访问总人数:251858人 6秒前 44.57%  粤ICP备18100884号-2