我想将日期转换为月份名称和年份。像转换日期到月份名称和年份
July, 2017
这里
$date = '2017-07-00';
$date = date('m/y', strtotime($date));
echo DATE_FORMAT($date, '%M %Y');
我期待输出错误我就是你没有使用正确的参数,使用F
蛾和Y
为一年获得
Warning: date_format() expects parameter 1 to be DateTimeInterface, string given
你似乎混淆了MySQL的'DATE_FORMAT'和PHP'date_format'。阅读文档。 –
7月的0日是什么意思? –
我通过连接添加了'00',因为我只通过使用输入类型=“月”来获取月份和年份,并将它以日期格式存储为I连接。 @BartFriederichs –