Freemarker date formatting processing

Artificial intelligence, zero-based entry! http://www.captainbed.net/inner 

Basic parameters:

【1】date: only display the date, not the time
  such as ${createTime?date}or${createTime?date('yyyy-MM-dd')}

【2】time: only display the time, not the date
  such as ${createTime?time}or${createTime?time('hh:mm:ss')}

【3】datetime: time and date are displayed at the same time,
  such as ${createTime}or ${createTime?datetime('yyyy-MM-dd hh:mm:ss')}or${createTime?string('yyyy-MM-dd hh:mm:ss')}

Freemarker presets some date formats

${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

String type:

Date format: ${book.date?string('yyyy-MM-dd')} 

Guess you like

Origin blog.csdn.net/qq_35860138/article/details/103833331