https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-formathtml
mysql 相似to_char() to_date()函数
mysql日期和字符相互转换方法
date_format(date,'%Y-%m-%d') -------------->oracle中的to_char();
str_to_date(date,'%Y-%m-%d') -------------->oracle中的to_date();
%Y:表明4位的年份
%y:表明2为的年份
%m:表明月, 格式为(01……12)
%c:表明月, 格式为(1……12)
%d:表明月份中的天数,格式为(00……31)
%e:表明月份中的天数, 格式为(0……31)
%H:表明小时,格式为(00……23)
%k:表明 小时,格式为(0……23)
%h: 表明小时,格式为(01……12)
%I: 表明小时,格式为(01……12)
%l :表明小时,格式为(1……12)
%i: 表明分钟, 格式为(00……59)
%r:表明 时间,格式为12 小时(hh:mm:ss [AP]M)
%T:表明 时间,格式为24 小时(hh:mm:ss)
%S:表明 秒,格式为(00……59)
%s:表明 秒,格式为(00……59)
SELECT DATE_FORMAT(20130111191640,'%Y-%m-%d %H:%i:%s')
DATE_FORMAT(20130111191640,'%Y-%m-%d %H:%i:%s')
————————————————
版权声明:本文为CSDN博主「coco爱火女」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处连接及本声明。
原文连接:https://blog.csdn.net/u011424470/article/details/79637978mysql