mysql in the year (date) and date_format (date, format) usage

执行:select SYSDATE() from dual;

Returns: 2017-10-24 13:48:06

执行:select DATE_FORMAT(SYSDATE(),'%Y.%m.%d') from  dual;

Get: 2017.10.24

Conclusion: DATE_FORMAT (date, format) The date is displayed as a custom style

执行:select year(SYSDATE()) from dual;

Get: 2017

Conclusion: year (date) is the year to get a date

For more: Click on the link to open

Original Address: https: //blog.csdn.net/lwang_it/article/details/78328733

Guess you like

Origin www.cnblogs.com/jpfss/p/11225774.html