Oracle 5.0 Reference Manual page 942

Table of Contents

Advertisement

Specifier
%p
%r
%S
%s
%T
%U
%u
%V
%v
%W
%w
%X
%x
%Y
%y
%%
%x
Ranges for the month and day specifiers begin with zero due to the fact that MySQL permits the
storing of incomplete dates such as '2014-00-00'.
As of MySQL 5.0.25, the language used for day and month names and abbreviations is controlled
by the value of the
lc_time_names
Support").
As of MySQL 5.0.36,
given by
character_set_connection
return month and weekday names containing non-ASCII characters. Before 5.0.36, the return value
is a binary string.
mysql>
SELECT DATE_FORMAT('2009-10-04 22:23:00', '%W %M %Y');
-> 'Sunday October 2009'
mysql>
SELECT DATE_FORMAT('2007-10-04 22:23:00', '%H:%i:%s');
-> '22:23:00'
mysql>
SELECT DATE_FORMAT('1900-10-04 22:23:00',
->
-> '4th 00 Thu 04 10 Oct 277'
mysql>
SELECT DATE_FORMAT('1997-10-04 22:23:00',
->
-> '22 22 10 10:23:00 PM 22:23:00 00 6'
mysql>
SELECT DATE_FORMAT('1999-01-01', '%X %V');
-> '1998 52'
mysql>
SELECT DATE_FORMAT('2006-06-00', '%d');
-> '00'
DATE_SUB(date,INTERVAL expr unit)
See the description for
[922]
DAY(date)
[922]
is a synonym for
DAY()
Date and Time Functions
Description
or
AM
PM
Time, 12-hour
(hh:mm:ss
Seconds (00..59)
Seconds (00..59)
Time, 24-hour (hh:mm:ss)
Week (00..53), where Sunday is the first day of the week
Week (00..53), where Monday is the first day of the week
Week (01..53), where Sunday is the first day of the week; used with
Week (01..53), where Monday is the first day of the week; used with
Weekday name (Sunday..Saturday)
Day of the week (0=Sunday..6=Saturday)
Year for the week where Sunday is the first day of the week, numeric, four
digits; used with
%V
Year for the week, where Monday is the first day of the week, numeric, four
digits; used with
%v
Year, numeric, four digits
Year, numeric (two digits)
A literal "%" character
x, for any "x" not listed above
[462]
system variable
[921]
DATE_FORMAT()
[442]
'%D %y %a %d %m %b %j');
'%H %k %I %r %T %S %w');
[919].
DATE_ADD()
DAYOFMONTH()
922
followed by
or PM)
AM
(Section 10.7, "MySQL Server Locale
returns a string with a character set and collation
and
collation_connection
[922]
[923].
%X
%x
[443]
so that it can

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents