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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Roland

几个基本的计算机概念 Silverlight 5几个不错的新特性 无光驱采用U盘安装完整版xp jQuery URL Parser 帮助 .net环境下的javascript引擎汇总 使用ANTLR进行命令行参数解析 使用VSTA定制二次开发IDE(一) 探讨Antlr中文文法与英文文法的差异 .net与java中关于访问性的差异 基础知识之vb.net的拷贝构造函数 垃圾回收浅谈 ASP.NET 页面对象模型[转自Msdnchina] dotnetnuke小结 dotnetnuke中皮肤管理小问题 DNN中令人困惑的用户管理机制 第一次学习dotnetnuke [转帖]怎样成为优秀的软件模型设计者? [转帖]论程序设计方法 让VFP回到旧时代
javascript 日期格式化(转)
Roland · 2011-08-03 · via 博客园 - Roland

原文及附件:http://blog.stevenlevithan.com/archives/date-time-format

dDay of the month as digits; no leading zero for single-digit days.ddDay of the month as digits; leading zero for single-digit days.dddDay of the week as a three-letter abbreviation.ddddDay of the week as its full name.mMonth as digits; no leading zero for single-digit months.mmMonth as digits; leading zero for single-digit months.mmmMonth as a three-letter abbreviation.mmmmMonth as its full name.yyYear as last two digits; leading zero for years less than 10.yyyyYear represented by four digits.hHours; no leading zero for single-digit hours (12-hour clock).hhHours; leading zero for single-digit hours (12-hour clock).HHours; no leading zero for single-digit hours (24-hour clock).HHHours; leading zero for single-digit hours (24-hour clock).MMinutes; no leading zero for single-digit minutes.
Uppercase M unlike CF timeFormat's m to avoid conflict with months.MMMinutes; leading zero for single-digit minutes.
Uppercase MM unlike CF timeFormat's mm to avoid conflict with months.sSeconds; no leading zero for single-digit seconds.ssSeconds; leading zero for single-digit seconds.l or LMilliseconds. l gives 3 digits. L gives 2 digits.tLowercase, single-character time marker string: a or p.
No equivalent in CF.
ttLowercase, two-character time marker string: am or pm.
No equivalent in CF.
TUppercase, single-character time marker string: A or P.
Uppercase T unlike CF's t to allow for user-specified casing.
TTUppercase, two-character time marker string: AM or PM.
Uppercase TT unlike CF's tt to allow for user-specified casing.
ZUS timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the Opera browser, the GMT/UTC offset is returned, e.g. GMT-0500
No equivalent in CF.
oGMT/UTC timezone offset, e.g. -0500 or +0230.
No equivalent in CF.
SThe date's ordinal suffix (st, nd, rd, or th). Works well with d.
No equivalent in CF.
'…'or"…"Literal character sequence. Surrounding quotes are removed.
No equivalent in CF.
UTC:Must be the first four characters of the mask. Converts the date from local time to UTC/GMT/Zulu time before applying the mask. The "UTC:" prefix is removed.
No equivalent in CF.
Mask Description

And here are the named masks provided by default (you can easily change these or add your own):

defaultddd mmm dd yyyy HH:MM:ssSat Jun 09 2007 17:46:21shortDatem/d/yy6/9/07mediumDatemmm d, yyyyJun 9, 2007longDatemmmm d, yyyyJune 9, 2007fullDatedddd, mmmm d, yyyySaturday, June 9, 2007shortTimeh:MM TT5:46 PMmediumTimeh:MM:ss TT5:46:21 PMlongTimeh:MM:ss TT Z5:46:21 PM ESTisoDateyyyy-mm-dd2007-06-09isoTimeHH:MM:ss17:46:21isoDateTimeyyyy-mm-dd'T'HH:MM:ss2007-06-09T17:46:21isoUtcDateTimeUTC:yyyy-mm-dd'T'HH:MM:ss'Z'2007-06-09T22:46:21Z
Name Mask Example