为什么不';这段代码除了显示日期外,还显示时间


Why doesn't this code render the time in addition to the date?

此代码显示日期(月、日、年),但不显示时间。它正在php上传网站上使用。我很感激你的建议。非常感谢。

<time datetime="<?= date( 'm-d-Y', strtotime( $file->added ) ) ?>"><?= date( 'm.d.Y', strtotime( $file->added ) ) ?>

您需要将输出时间的请求添加到date()函数的参数1中。

<time datetime="<?= date( 'm-d-Y H:i:s', strtotime( $file->added ) ) ?>"><?= date( 'm.d.Y H:i:s', strtotime( $file->added ) ) ?>