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

 

你可能感兴趣的:(mysql)