How to convert MM/DD/YYYY to YYYY-MM-DD?

前端 未结 10 1808
忘了有多久
忘了有多久 2020-12-14 18:03

I have a jquery calendar that sets the input value to MM/DD/YYYY

How would I convert it so that my database column (date) can accept it correctly?

EDIT

10条回答
  •  感动是毒
    2020-12-14 18:59

    $date = "07/12/2010";
    $your_date = date("Y-m-d", strtotime($date));
    

    I hope my answer is useful :)

提交回复
热议问题