输出格式:

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

 

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-09-23
  • 2021-11-18
猜你喜欢
  • 2021-08-03
  • 2021-12-22
  • 2021-05-20
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案