mysql date_format( )

 

 

Original connection

 

 

 

 

 

 

 

 

 

MySQL> the SELECT
-> the NOW (),
-> the DATE_FORMAT (the NOW (), '..%% the C-Y-E%%% I% S K') A;
+ ----------- + -------------------- + ----------
| the NOW () | A |
+ ---------- + -------------------- + -----------
| 2011-08-10 11:03:42 | 2011-8-10 11.03.42 |
+ --------------------- + -------------------- +
1 Row in set (0.00 sec)

Note:
the DATE_FORMAT

% W week name (Sunday ...... Saturday)
% D have English prefix month of the date (. 1st, 2nd, 3rd, etc.) %
in the Y-digital, four
% y Year digital position 2
% a week abbreviated name (Sun ...... Sat)
days% d month, numbers (00 ...... 31)
the number of days in the month% e, digital (0 ...... 31)
% m month, digital (01 ...... 12)
% c month, numbers (1 ...... 12)
% b abbreviated month name (Jan ...... Dec)
the number of days in the% j year (001 ...... 366)
% H hour (00 ...... 23 )
% k h (0 ...... 23 is)
% h H (01 ...... 12 is)
% the I h (01 ...... 12 is)
% L h (12 is ....... 1)
% I min, digital (00 ...... 59)
% R & lt time 12 hours (HH: mm: SS [the AP] M)
% T time, 24 hours (HH: mm: SS)
% S seconds (00 ...... 59)
% S seconds (00 ...... 59)
% P AM or PM
% w number of days of the week (0 = Saturday the Sunday = ....... 6) %
the U-week (0 ...... 52), where the first day of the week is Sunday
% u week (0 ...... 52), where the week Monday the first day
%% a literal "%."

All other characters no explanation is copied to the result.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

Guess you like

Origin www.cnblogs.com/Skate0rDie/p/12157643.html