how to change date format on this html user form

前端 未结 3 1551
抹茶落季
抹茶落季 2021-01-27 09:22

I have the html form which enter data into mysql DB, but in input field of date it has this format,

(mm/dd/yyyy) 

BUT I prefer to use this form

3条回答
  •  遥遥无期
    2021-01-27 10:05

    use this code

    $originalDate = "2010-03-21";
    $newDate = date("d-m-Y", strtotime($originalDate));
    

提交回复
热议问题