`
azvf
  • 浏览: 144254 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

mysql 字串转日期

阅读更多

SELECT date_format('2013-01-01','%Y-%c-%d %h:%i:%s') sale_date

 

 

 

扩展:

 

%Y:年

%c:月

%d:日

%H:小时

%i:分钟

%s:秒

 

mysql> select date_format(now(),'%Y-%c-%d %h:%i:%s');

+----------------------------------------+

| date_format(now(),'%Y-%c-%d %h:%i:%s') |

+----------------------------------------+

| 2009-8-07 06:59:40                     |

+----------------------------------------+

1 row in set (0.00 sec)

  • 大小: 17.5 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics