mysql从字符串中获取时间的案例:
addtime='2020-11-17 15:47:50'substr(addtime,1,10) as 创建日期SUBSTR(string, string charcter, number of charcters)
substr(addtime,1,10) as 创建日期
SUBSTR(string, string charcter, number of charcters)
参数含义:
string:为字符列或字符串表达式
string charcter:子串的起始位置
number of charcters:返回字符的个数