php date_format函数的正确模式

问题描述 投票:-3回答:2

在PHP中,使用date_format函数将日期值'2014-06-18'呈现为'18 / jun'的正确格式是什么?这是我尝试过但无法正常工作的代码

<h3><?=date_format($evento->fecha,'j/M') ?></h3>
php date-formatting
2个回答
2
投票

您想同时使用strtotime()strtotime()

date()


0
投票

来自date()

echo date('d/M', strtotime('2014-06-18')) //outputs 18/Jun
© www.soinside.com 2019 - 2024. All rights reserved.