您的位置:首页 > 其它

freemaker日期格式化处理

2017-04-25 19:50 155 查看
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-dd hh:mm:ss')}


${createTime?string.short}  01:45 PM
${createTime?string.medium}  01:45:09 PM
${createTime?string.long}  01:45:09 PM PST
${createTime?string.full}  01:45:09 PM PST
${createTime?string.xs}  13:45:09-08:00
${createTime?string.iso}  13:45:09-08:00


字符串类型:

日期格式:${book.date?string(‘yyyy-MM-dd’)}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: