輸出格式:
{$time|strtotime|date="Y年m月d日",###}
格式說明:
$time 是日期字符串,一般后台的時間是"Y-m-d H:i:s"
strtotime()把字符串轉化為時間整數
date(format, timestamp) 把整數時間timestamp按照format格式轉換為字符串
"###"表示前面的變量(即$time)在date函數中的傳入位置
舉例:
<span>{$v.artdate}</span> // 2018-11-28 10:08:55 或 2018-11-28 10:08:55.000
<span>{$v.artdate|strtotime|date="Y-m-d H:i",###}</span> // 2018-11-28 10:08