mysql获取日期(将时间戳转换成短日期格式)

且看如下:

select date_format(create_time,'%Y.%m.%d'),create_time from vs_article where article_id='20';

 

结果:

+-------------------------------------+---------------------+
| date_format(create_time,'%Y-%m.%d') | create_time         |
+-------------------------------------+---------------------+
| 2014-12.17                          | 2014-12-17 11:44:03 |
+-------------------------------------+---------------------+
1 row in set

 

posted @ 2014-12-28 10:44  飞剑  阅读(1681)  评论(0编辑  收藏  举报