*Freemarker日期格式化处理
基本参数:
date: 只显示日期,不显示时间.
如createTime?date或{createTime?date(‘yyyy-MM-dd’)}
time: 只显示时间,不显示日期
如createTime?time或{createTime?time(‘hh:mm:ss’)}
datetime: 时间和日期同时显示
如createTime或{createTime?datetime(‘yyyy-MM-dd hh:mm:ss’)}或createTime?string(‘yyyy−MM−ddhh:mm:ss′)Freemarker预置了一些日期格式{createTime?string.short} 01:45 PM
createTime?string.medium01:45:09PM{createTime?string.long} 01:45:09 PM PST
createTime?string.full01:45:09PMPST{createTime?string.xs} 13:45:09-08:00
createTime?string.iso13:45:09−08:00字符串类型:日期格式:{book.date?string(‘yyyy-MM-dd’)}*
Freemarker(ftl)时间格式化
最新推荐文章于 2023-03-10 17:50:46 发布
本文介绍了Freemarker模板引擎中日期格式化的多种方法,包括只显示日期、只显示时间及同时显示日期和时间的不同格式选项。此外还提供了预置的日期格式,如短格式、中等格式、长格式和完整格式。


1411

被折叠的 条评论
为什么被折叠?



