【发布时间】:2015-10-27 21:32:52
【问题描述】:
我有一个变量 $日期
其中包含以下格式的日期: '2015 年 8 月 24 日,星期一'
或者作为一个strtotime: '1440716400'
我想将其更改为以下格式: '2015 年 8 月 24 日'
请问我该怎么做?
【问题讨论】:
标签: php date variables strtotime
我有一个变量 $日期
其中包含以下格式的日期: '2015 年 8 月 24 日,星期一'
或者作为一个strtotime: '1440716400'
我想将其更改为以下格式: '2015 年 8 月 24 日'
请问我该怎么做?
【问题讨论】:
标签: php date variables strtotime
只需date()
$timestamp = strtotime('Monday, 24 August 2015');
echo date("d/m/Y", $timestamp); // Here you put the format you want
【讨论】:
试试
date("d/m/Y", strtotime('Monday, 24 August 2015'));
【讨论】: