Freemarker(ftl)时间格式化

来源:互联网 发布:mac 思维导图软件下载 编辑:程序博客网 时间:2024/06/06 01:53

*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(yyyyMMddhh: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:0908:00{book.date?string(‘yyyy-MM-dd’)}*