velocity 时间显示 时间格式化 时间转化
来源:互联网 发布:人工智能产品代理 编辑:程序博客网 时间:2024/05/01 10:16
思想:通过前台展现层(Velocity)中的工具(tools)方法来修改。
***************
具体修改步骤:
1、在toolbox.xml配置文件中添加以下代码:
<tool>
<key>date</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.DateTool</class>
</tool>
2、在前台页面中需要显示时间的地方添加这样的代码:
例如:要显示的时间为:$!user.time
那么添加的代码为:
$!date.format('yyyy-MM-dd HH:mm:ss ',$!user.time)
其中'yyyy-MM-dd HH:mm:ss '格式可以自己定义。
***************
具体修改步骤:
1、在toolbox.xml配置文件中添加以下代码:
<tool>
<key>date</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.DateTool</class>
</tool>
2、在前台页面中需要显示时间的地方添加这样的代码:
例如:要显示的时间为:$!user.time
那么添加的代码为:
$!date.format('yyyy-MM-dd HH:mm:ss ',$!user.time)
其中'yyyy-MM-dd HH:mm:ss '格式可以自己定义。
0 0
- velocity 时间显示 时间格式化 时间转化
- velocity 时间显示 时间格式化 时间转化
- velocity (vm模板)时间显示 时间格式化 时间转化
- velocity 格式化时间
- velocity格式化时间
- Velocity 时间格式化问题
- velocity 时间显示
- 时间的显示转化
- 格式化显示时间函数
- js_格式化显示时间
- 格式化显示时间(实例)
- 时间格式化显示
- js格式化显示时间
- 来格式化时间显示正确的时间
- delphi 时间格式化,动态显示时间,显示最新时间
- JavaScript如何将unix时间戳转化为UTC时间并格式化显示
- java 格式化显示当前时间。
- 字符串格式化显示小数、时间
- 21点扑克游戏
- android SharedPreferences 的使用
- npm 国内镜像
- 【shell】linux下java运行lib里的class
- 第五周项目3-对象数组操作长方柱类
- velocity 时间显示 时间格式化 时间转化
- maven的pom报maven-surefire-plugin却是的解决办法
- error C2664: strcpy : 不能将参数 2 从 CString 转换为 const char *;error C2440: “初始化”: 无法从“const wchar_t [15]”
- 让乌龟SVN(TortoiseSVN)提交时忽略bin和obj目录
- Unity 3D引擎:十大最火的插件推荐
- linux文件区分大小写,不方便在windows下面开发管理
- IOS之上传图片
- nginx与tomcat整合及其他模块化
- vs2010提示error C2440: “=”: 无法从“wchar_t *”转换为“char *”,求解