作者:我的老公是个兵 | 来源:互联网 | 2023-05-18 03:45
select str_to_date(‘2008-4-2 15:3:28‘,‘%Y-%m-%d %H:%i:%s‘);
select str_to_date(‘2008-08-09 08:9:30‘, ‘%Y-%m-%d %h:%i:%s‘);
select str_to_date(‘20151222‘, ‘%Y%m%d‘);
select str_to_date(‘20151222‘, ‘%y%y%m%d‘);
注意:%Y-代表4位,%y-代表两位
MySQL字符串转日期