Mysql date function date_format ()

Usage: DATE_FORMAT () function is used to display the date / time data in different formats

1, grammar

date_fromat(date,format)   

Description: date parameter is legitimate date. format output format predetermined date / time.

2, format

% D month of day value (00-31)

% p morning, afternoon identification, AM or the PM  
% h H, values (01-12) 12-hour% H hour value (00-23) 24-hour

% M month, month name (English)

% M month, values ​​(00-12)

% Y Year, four

% Y Year, 2

Guess you like

Origin www.cnblogs.com/Small-sunshine/p/11468881.html