且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-02-04 19:07:16

date ,Y,strtotime($ input))


I am pulling the dates of various posts from a database. The dates are in the following format:

2009-08-12

Numeric Year - Numeric Month - Numeric Day

How can I reformat these dates to something more user friendly like:

August 12, 2009

Numeric Month Numeric Date, Numeric Year

Assuming that the date gotten from the mysql database is stored in a variable called:

$date = $row['date_selected'];

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