HTML input datetime-local 类型 设置默认值

2021-06-22 16:00 阅读:2516

默认值格式:2021-01-01T01:30

PHP示例:

// 原始时间为时间戳
$time = '1624348436';
$date = date('Y-m-d', $time)."T".date('H:i:s', $time);

// 原始时间为格式化后的日期
$time = '2021-06-22 15:18:00';
$date = date('Y-m-d', strtotime($time))."T".date('H:i:s', strtotime($time));

echo $date; //2021-06-22T15:18:00


{{commentTotal}} 条评论

{{item.nickname}}
{{item.create_date}}
{{item.content}}
- 上拉或点击加载更多 -
- 加载中 -
- 没有更多了 -
- 本文链接 -