How to convert csv date format to into mysql db

后端 未结 3 714
遇见更好的自我
遇见更好的自我 2020-12-19 15:05

At csv file, the date field is in such format:

2/9/2010 7:32
3/31/2011 21:20

I am using php + mysql for development.

I need to read

3条回答
  •  清歌不尽
    2020-12-19 15:15

    Use the STR_TO_DATE() function.

    Example

    STR_TO_DATE('3/31/2011 21:20', '%c/%e/%Y %H:%i');
    

提交回复
热议问题