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

时间:2023-03-08 16:27:29

且看如下:

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

结果:

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