Template:MYSQLDATETIMEFORMATS

From SmartWiki
Jump to: navigation, search
Format Description
%M %d, %Y will return date in format of September 30, 2012
%a will return the truncated day of the week, e.g. Sun. for Sunday
%b will return the truncated name of the month, e.g. Sep for September
%c will return the month number in short format, e.g. 9 for September
%d will return the numeric day of month (01-31)
%e will return the numeric day of month (1-31)
%h will return hour (01-12)
%i will return minutes (00-59)
%j will return day of year (001-366)
%k will return hour (0-23)
%l will return hour (1-12)
%m will return the month number, e.g. 09 for September
%p will return AM/PM information, e.g. AM
%r will return the full time in 12-hour format, e.g. 12:00:00 AM
%s will return seconds (00-59)
%u will return the week number (00-53) where Monday is the first day of the week
%w day of the week (0=Sunday...6=Saturday)
%y will return the truncated year, e.g. 12 for 2012
%D will return the month ordinal, e.g. 30th
%H will return hour (00-23)
%M will return the month name, e.g. September
%T will return the full time in 24-hour format, e.g. 23:00:00
%U will return the week number (00-53) where Sunday is the first day of the week
%W will return the day of the week, e.g. Sunday
%Y will return the four-digit year, e.g. 2013