thinkphp 5 在页面输出当前时间

我遇到的使用场景是<input>默认为当前时间,代码如下:

<input name="starttime" id="starttime" type="text" class="input_245_34 fl" value="{$department['starttime']|default=time()|date='Y-m-d',###}">
  1. time():输出当前时间戳
  2. date='Y-m-d',###:格式化为日期形式
posted @ 2020-04-26 20:42  shellon  阅读(1292)  评论(0编辑  收藏  举报