惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - Daniel Pang

pcanywhere失去连接的一个解决方法 [软件共享]将数据库中的数据导出为SQL脚本 对文件下载的补充 - Daniel Pang - 博客园 复制DataTable的一种方法 IBatisNet + Castle 开发相关文章 [IBatisNet]关于返回DataTable的一点问题 深圳电话订票基本步骤及所有的取票点地址电话 Automatic Transaction Management Facility 使用 - Daniel Pang IBatisnet Facility 的几种配置 - Daniel Pang IBatisNet -- 保护你的配置文件及映射文件信息 Rational Rose 加载出错的问题 修改Sql server中列的属性脚本 字符串加密方法 ERP术语 英文对照(部分)(参考) 一个关于SQL2005的问题 动态加载TreeNode -- ComponentArt TreeView - Daniel Pang 使用IBatisNet + Castle 开发DotNet软件 JS--屏蔽浏览器右键菜单 Excel的导出操作 - Daniel Pang - 博客园
JS格式化日期字符串 - Daniel Pang - 博客园
Daniel Pang · 2008-02-29 · via 博客园 - Daniel Pang

 1//格式化日期
 2Date.prototype.format = function(format)
 3{
 4    var o =
 5    {
 6        "M+" : this.getMonth()+1//month
 7        "d+" : this.getDate(),    //day
 8        "h+" : this.getHours(),   //hour
 9        "m+" : this.getMinutes(), //minute
10        "s+" : this.getSeconds(), //second
11        "q+" : Math.floor((this.getMonth()+3)/3),  //quarter
12        "S" : this.getMilliseconds() //millisecond
13    }

14    if(/(y+)/.test(format))
15    format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length));
16    for(var k in o)
17    if(new RegExp("("+ k +")").test(format))
18    format = format.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
19    return format;
20}

21