寻找一种在速度模板中检索日期的方法
我试图在速度模板中获取系统日期,但是 修改日期时间=“$日期” 结果 ModifiedDateTime="$date" 而不是 ModifiedDateTime="Jan 11, 2011 9:54:50 AM"
我的所有其他变量和调用都按预期工作,但这是我的第一个 Velocity 模板,我能在 $date 找到的所有内容。
I'm trying to get the System date in a velocity template, but
ModifiedDateTime="$date"
results in
ModifiedDateTime="$date" instead of ModifiedDateTime="Jan 11, 2011 9:54:50 AM"
All of my other variables and calls work as supposed to, but this is my first Velocity template and everything I can find points at $date.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为您需要提供
$date
变量,例如此处< /a>I think you need to provide
$date
variable like herehttp://velocity.apache .org/tools/releases/2.0/javadoc/org/apache/velocity/tools/generic/DateTool.html
对于此类事情非常有帮助......
http://velocity.apache.org/tools/releases/2.0/javadoc/org/apache/velocity/tools/generic/DateTool.html
is very helpful for such things...
所以打包了velocity工具...必须使用$tools.date,
So velocity tools were packaged...had to use $tools.date,