如何在PHP中重新格式化日期?

我正在从数据库中提取各种帖子的日期。日期采用以下格式:

2009-08-12

Numeric Year - Numeric Month - Numeric Day

如何将这些日期重新格式化为更用户友好的格式:

August 12, 2009

Numeric Month Numeric Date, Numeric Year

假设从mysql数据库获取的日期存储在名为:

$date = $row['date_selected'];

回答:

date("F d, Y", strtotime($input))

以上是 如何在PHP中重新格式化日期? 的全部内容, 来源链接: utcz.com/qa/402295.html

回到顶部