zoukankan      html  css  js  c++  java
  • 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-dd hh:mm:ss')}

    Freemarker预置了一些日期格式

    ${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')} 

    文/Devid(简书作者)
    原文链接:http://www.jianshu.com/p/980aaeea3402
    著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
  • 相关阅读:
    最少换乘
    hdu5441 Travel
    hdu 5444 Elven Postman(水)
    hdu5443 The Water Problem(水)
    hdu5438 Ponds
    poj 3281
    Light OJ
    2016中国大学生程序设计竞赛
    2016中国大学生程序设计竞赛
    UVA 10200 Prime Time (打表)
  • 原文地址:https://www.cnblogs.com/w1217/p/5972081.html
Copyright © 2011-2022 走看看