Date_forma T (date, format) returns a string of results based on format date or date and time value date according to the format string formatting.
You can format date or datetime values in Date_format () to get the desired format. Format date values according to the format string:
%s,%s two-digit form of seconds (00, 01, ..., 59)
%i Two-digit form (00, 01, ..., 59)
%H two digits in the form of hours, 24 hours (00,01, ..., 23)
%h,%I Two digits in the form of hours, 12 hours (01,02, ..., 12)
%k digital form of hours, 24 hours (0,1, ..., 23)
%l digital form of hours, 12 hours (1, 2, ..., 12)
%T 24-hour time form (H h:m m:s s)
%r 12-hour time form (Hh:mm:ss AM or Hh:mm:ss PM)
%p AM or P M
%w the name of each day of the week (S u n d a y, Monday, ..., Saturday)
%a the name of each day of the week (Sun, Mon, ..., Sat)
%d two digits indicates the number of days in the month (00, 01, ..., 31)
%e numeric form represents days of the month (1, 2, ..., 31)
%d The English suffix indicates the number of days in the month (1st, 2nd, 3rd, ...)
%w represents the number of days in the week (0 = S u n d a y, 1=monday, ..., 6=saturday)
%j a three-digit number of days in the year (001, 002, ..., 366)
% U Week (0, 1, 52), where Sunday is the first day of the week
%u weeks (0, 1, 52), where Monday is the first day of the week
%m Month name (J a n u a r y, February, ..., December)
%b Abbreviated month name (J a n u a r y, February, ..., December)
%m two digits of the month (01, 02, ..., 12)
The month (1, 2, ..., 12) that is represented by the%c number.
%Y four digits of year
%y two digits of year
Percent% direct value "%"
Select Date_format (Date field, '%y-%m-%d ') as ' date ' from test