您好,我想将日期转换为其他格式。以下是我尝试但没有奏效的内容:
$expirationdate = 22nd November 2021;
$newDate = date("'d\<\s\u\p\>S\<\/\s\u\p\> F Y", strtotime($expirationdate));
谢谢
答案 0 :(得分:0)
将dateformat F转换为M
$expirationdate = '22nd November 2021';
echo $newDate = date('d M Y', strtotime($expirationdate));
如果您需要“ 22nd”
echo $newDate = date('dS M Y', strtotime($expirationdate));