Ext.Net_Ext.Net.DateColumn 日期格式问题
2011-07-19 14:36
309 查看
在使用DateColumn 时,会用到日期格式,代码如下:
<ext:DateColumn Header="日期" DataIndex="FINSERTEDDATE"Format="Y-m-d H:i:s"></ext:DateColumn>那么EXT.NET日期格式是什么?之前以为跟数据库的格式差不多,又在EXT.NET CHM文档中找,都不对,其实,EXT.NET源代码就是最好的文档。
EXT.NET源代码片段
d:"String.leftPad(this.getDate(), 2, '0')", D:"Date.getShortDayName(this.getDay())", j:"this.getDate()", l:"Date.dayNames[this.getDay()]", N:"(this.getDay() ? this.getDay() : 7)", S:"this.getSuffix()", w:"this.getDay()", z:"this.getDayOfYear()", W:"String.leftPad(this.getWeekOfYear(), 2, '0')", F:"Date.monthNames[this.getMonth()]", m:"String.leftPad(this.getMonth() + 1, 2, '0')", M:"Date.getShortMonthName(this.getMonth())", n:"(this.getMonth() + 1)", t:"this.getDaysInMonth()", L:"(this.isLeapYear() ? 1 : 0)", o:"(this.getFullYear() + (this.getWeekOfYear() == 1 &&this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 &&this.getMonth() < 11 ? -1 : 0)))", Y:"String.leftPad(this.getFullYear(), 4, '0')", y:"('' + this.getFullYear()).substring(2, 4)", a:"(this.getHours() < 12 ? 'am' : 'pm')", A:"(this.getHours() < 12 ? 'AM' : 'PM')", g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)", G:"this.getHours()", h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2,'0')", H:"String.leftPad(this.getHours(), 2, '0')", i:"String.leftPad(this.getMinutes(), 2, '0')", s:"String.leftPad(this.getSeconds(), 2, '0')", u:"String.leftPad(this.getMilliseconds(), 3, '0')", O:"this.getGMTOffset()", P:"this.getGMTOffset(true)", T:"this.getTimezone()", Z:"(this.getTimezoneOffset() * -60)",
说明
根据它们的函数名能猜到它们的含义。比如,Y和y表示年;M和m表示月;D和d表示天;H和h表示小时;i表示分;s和u表示秒;A和a表示上下午。其他的如,L表示是否为闰年;O和P表示格林威治标准时间(GMT),英国的标准时间,也是世界各地时间的参考标准。中英两国的标准时差为8个小时,即英国当地时间比中国北京时间晚8小时;T和Z表示协调世界时(UTC)等等。以2011-07-14 14:05:37为例
格式 | 结果 |
Y-m-d H:i:s | 2011-07-14 14:05:37 |
y-m-d H:i:s | 11-07-14 14:05:37 |
y-M-d H:i:s | 2011-7-14 14:05:37 |
y-m-d H:i:s L | 2011-7-14 14:05:37 0 |
y-m-d H:i:s T | 2011-7-14 14:05:37 UTC |
y-m-d H:i:s Z | 2011-7-14 14:05:37 28800 |
y-m-d H:i:s O | 2011-7-14 14:05:37 +0800 |
y-m-d H:i:s P | 2011-7-14 14:05:37 +08:00 |
Y-m-d h:i:s | 2011-07-14 2:05:37 |
Y-m-d H:i:s G | 2011-7-14 14:05:37 14 |
Y-m-d H:i:s a | 2011-7-14 14:05:37 下午 |
Y/m/d H:i:s | 2011/07/14 14:05:37 |
Y/m/dH:i:s | 2011/07/1414:05:37 |
说明
只要字母写对了,字母与字母间的字符无所谓,EXT.NET会原样显示。相关文章推荐
- Ext.Net 1.2.0_Ext.Net.DateColumn 日期格式问题
- Ext.form.field.Date 日期格式和java date格式互相转换
- 解决Struts2 json-plugin Date或Timestamp等日期格式带T的问题
- IIS时间格式设置问题(ASP.net日期格式不对)
- 关于日期转换和自定义日期格式的问题(DateFormat)
- 关于如何处理JSONObject.fromObject(Object obj)无法转换特殊日期(java.sql.Date,java.sql.Timestamp)格式的问题。
- Gson使用中遇到的Date格式问题。日期格式处理
- 关于如何处理JSONObject.fromObject(Object obj)无法转换特殊日期(java.sql.Date,java.sql.Timestamp)格式的问题。
- 解决Struts2 json-plugin Date或Timestamp等日期格式带T的问题
- 解决EXT.NET年月日期弹出框数据被遮盖的问题
- asp.net日期格式出现"/"的问题
- 【Jqurey EasyUI+Asp.net】---修改DateBox的默认日期格式
- JSON 日期格式问题 /Date(1325696521000)/
- JQuery返回Json日期格式的问题/Date(1387900800000)/
- ORACLE 日期格式(NLS_DATE_FORMAT)问题
- 解决asp.net core 日期格式 datetime Json返回 带T的问题
- 解决Struts2 json-plugin Date或Timestamp等日期格式带T的问题
- EasyUI修改DateBox和DateTimeBox的默认日期格式,中文问题
- .Net与JS时间日期格式的转换问题对比分析
- Ext.net 中日期格式的计算