甜橘子,专注成都网站制作网站设计与营销型网站建设与优化
QQ :
532337155
电话:
028-86922220
首页
网站建设
网站制作案例
解决方案
网站设计报价
网站制作动态
关于我们
联系我们
成都网站建设设计
将想法与焦点和您一起共享
mysql日期转换字符串
1、使用:DATE_FORMAT 将日期转换字符串,或者字符串转换日期
(1)将时间转换成字符串
将系统时间转换成字符串
MySQL> select date_format(now(), '%y%m%d %h:%i:%s');
+---------------------------------------+
| date_format(now(), '%y%m%d %h:%i:%s') |
+---------------------------------------+
| 160510 06:10:30 |
+---------------------------------------+
扩展: %Y:年 %c:月 %d:日 %H:小时 %i:分钟 %s:秒
(2)将字符串转成日期
partition_key
字段信息为:160101
mysql> select date_format(partition_key,'%y-%m-%d') from t_order ;
+---------------------------------------+
| date_format(partition_key,'%y-%m-%d') |
+---------------------------------------+
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
| 16-01-01 |
+---------------------------------------+
14 rows in set (1.67 sec)
当前题目:mysql日期转换字符串
当前网址:
http://chengdu.cdxwcx.cn/article/gipded.html
其他资讯
代运营如何找到客户,代运营成功例子分享
汉口短视频代运营多少钱
浙江抖音账号直播运营方式,抖音账号直播运营操作有哪些技巧?
专业短视频代运营介绍价格,如何选择可靠的短视频代运营公司
榆林短视频运营哪家好
QQ咨询
在线咨询
官方微信
联系电话
座机
028-86922220
手机
13518219792
返回顶部