How to convert date from one format to another?

前端 未结 4 973
温柔的废话
温柔的废话 2021-01-28 12:26

I\'m having the date in this format in a Excel worksheet 03-Dec-10. So its not compatible while inserting it into the database. How to convert the date to the acceptable format?

4条回答
  •  庸人自扰
    2021-01-28 12:57

    While Jon's answer is correct, here is another option:

    $input = '03-Dec-10';
    $date = date('Ymd', strtotime($input));
    

提交回复
热议问题