php convert date to MySQL date

后端 未结 4 1466
盖世英雄少女心
盖世英雄少女心 2021-01-24 03:11

I need to convert a date in this format:

November 28, 2009

to a MySQL date format:

2009-28-11

4条回答
  •  Happy的楠姐
    2021-01-24 03:52

    I like to use strtotime and the date function as follows:

    $mysql_date = date("Y-m-d", strtotime($source_date));

提交回复
热议问题