MySQL FORMAT Parameters

Term Usage Example
%e Day of the month 1-31
%d Day of the month, two digit 01-31
%D Day with suffix 1st - 31st
%W Weekday name Sunday - Saturday
%a Abbreviated Workday Name Sun-Sat
%c Month number 1 - 12
%m Month number, 2 digit 01 - 12
%M Month name January - December
%b Month name, abbreviated Jan - Dec
%Y Year 2002
%y Year (last 2 digits) 02
%l (lowercase L) Hour 1-12
%h Hour, 2 digit 01-12
%k Hour, 24 hour clock 0-23
%H Hour, 24 hour clock, two digit 00-23
%i Minutes 00-59
%S Seconds 00-59
%r Time 8:17:02 PM
%T Time, 24-hour clock 20:17:02
%p AM or PM AM or PM