zoukankan      html  css  js  c++  java
  • thinkphp前台html格式化输出日期

    输出格式:

    {$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
  • 相关阅读:
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    将Ojective-C代码移植转换为Swift代码
    Swift
    房费制——报表(1)
  • 原文地址:https://www.cnblogs.com/raswin/p/10025304.html
Copyright © 2011-2022 走看看