Php 为什么';这段代码除了显示日期外,还显示时间吗?
此代码显示日期(月、日、年),但不显示时间。它正在一个php上传站点上使用。我很感谢你的建议。多谢各位Php 为什么';这段代码除了显示日期外,还显示时间吗?,php,datetime,upload,Php,Datetime,Upload,此代码显示日期(月、日、年),但不显示时间。它正在一个php上传站点上使用。我很感谢你的建议。多谢各位 <time datetime="<?= date( 'm-d-Y', strtotime( $file->added ) ) ?>"><?= date( 'm.d.Y', strtotime( $file->added ) ) ?> 您需要添加请求以将时间输出到date()函数的参数1 <time datetime="<?= dat
<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 ) ) ?>
您忘记附加codeSheesh。抱歉,我不知道如何编辑该问题。下面是代码:为什么您认为此代码应该额外渲染时间?你知道“m-d-Y”和“m.d.Y”是什么意思吗?月-日-年。我想它会显示时间的,因为strottime。如果你有时间,请解释一下。谢谢。请阅读函数和文档。每次你不确定函数的功能是什么的时候,甚至不要试着猜测它的名字,但是阅读文档非常感谢。它很好用。我试过了