在页面显示当前系统日期及其格式化
来源:互联网 发布:加载更多js 编辑:程序博客网 时间:2024/06/06 02:03
在jsp页面显示系统的当前日期及其时间,在xml文档中的格式不同其在页面上的格式化的格式将也要有所区别,否则将无法显示或者达不到想要的效果!!!以下举例说明:
在xml中定义格式: 格式1.<genDate><fmt:formatDate pattern="yyyy-MM-dd" value="${vipCardList.genDate}"/></genDate>
格式2.<genDate>${fn:substring(vipCardList.genDate,0,16)}</genDate>
而在js中显示时则要用对应的格式才能正确的读取日期,
即:格式1.{id:'genDate', xtype:"datefield", fieldLabel:"创建时间", name:"textvalue",readOnly:true ,format:'Y-m-d'}
格式2.{id:'genDate', xtype:"datefield", fieldLabel:"创建时间", name:"textvalue",format:'Y-m-d h:m',readOnly:true}
另外在添加数据时,日期的初始化形式应为(此为ajax编写的js页面代码):
格式1:{id:'genDate', xtype:"datefield", fieldLabel:"创建时间", name:"textvalue",format:'Y-m-d,readOnly:true, value:new Date() }或者{id:'genDate', xtype:"datefield", fieldLabel:"创建时间", name:"textvalue",readOnly:true }
格式2{id:'genDate', xtype:"datefield", fieldLabel:"创建时间", name:"textvalue",format:'Y-m-d h:m',readOnly:true, value:new Date() }
两者的区别是:格式1读取的日期精确到天,显示的时间格式为:YYYY-MM-DD;而格式2读取的日期精确到分,显示的时间格式为:YYYY-MM-DD HH:MM
- 在页面显示当前系统日期及其格式化
- js在页面显示当前时间、日期
- 显示在页面当前系统时间
- 在页面显示系统当前时间
- JS在页面上显示当前日期和时间
- 在JSP页面显示当前日期或时间
- 在页面显示日期和当前时间,可以读秒
- 页面中显示当前日期
- 在JSP页面中获取系统当前日期时间
- jsp 显示当前系统日期
- 对DB2系统当前日期进行格式化
- 使用js获取系统当前时间并在页面显示
- web页面通过JS显示当前日期
- 在页面显示当前时间
- Jsp页面中获取系统当前日期
- 使用js代码在aspx页面动态显示当前日期和时间
- setTimeout用法:利用setTimeout在页面上不停的显示当前日期时间
- javascript实现显示系统当前日期
- 张亚勤:从香港台北看中国信息产业未来
- 日本尔必达在苏州建12英寸存储芯片工厂
- B2B行业不是“冬天”,而是“春天”
- Declare CreateObject 引用
- 文件的非递归深层搜索VISTA(程序代码)
- 在页面显示当前系统日期及其格式化
- delphi如何获取屏幕的分辨率
- Log4j学习笔记
- hint提示字用法(转)
- RTSP
- 一个左右移动的控件
- JTable 的编辑和表现 (转)
- 求最大公约数算法
- listview的用法