Oracle 5.0 Reference Manual page 943

Table of Contents

Advertisement

[923]
DAYNAME(date)
Returns the name of the weekday for date. As of MySQL 5.0.25, the language used for the name is
controlled by the value of the
Locale
Support").
mysql>
SELECT DAYNAME('2007-02-03');
-> 'Saturday'
DAYOFMONTH(date)
Returns the day of the month for date, in the range
or
that have a zero day part.
'2008-00-00'
mysql>
SELECT DAYOFMONTH('2007-02-03');
-> 3
DAYOFWEEK(date)
Returns the weekday index for
values correspond to the ODBC standard.
mysql>
SELECT DAYOFWEEK('2007-02-03');
-> 7
DAYOFYEAR(date)
Returns the day of the year for date, in the range
mysql>
SELECT DAYOFYEAR('2007-02-03');
-> 34
EXTRACT(unit FROM date)
The
[923]
EXTRACT()
[922], but extracts parts from the date rather than performing date arithmetic.
DATE_SUB()
mysql>
SELECT EXTRACT(YEAR FROM '2009-07-02');
-> 2009
mysql>
SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');
-> 200907
mysql>
SELECT EXTRACT(DAY_MINUTE FROM '2009-07-02 01:02:03');
-> 20102
mysql>
SELECT EXTRACT(MICROSECOND
->
-> 123
[923]
FROM_DAYS(N)
Given a day number N, returns a
mysql>
SELECT FROM_DAYS(730669);
-> '2007-07-03'
Use
[923]
FROM_DAYS()
precede the advent of the Gregorian calendar (1582). See
MySQL?".
FROM_UNIXTIME(unix_timestamp)
FROM_UNIXTIME(unix_timestamp,format)
Returns a representation of the
or
HH:MM:SS'
YYYYMMDDHHMMSS.uuuuuu
string or numeric context. The value is expressed in the current time zone.
internal timestamp value such as is produced by the
Date and Time Functions
lc_time_names
[923]
[923]
date (1
= Sunday,
[923]
[923]
function uses the same kinds of unit specifiers as
FROM '2003-01-02 10:30:00.000123');
value.
DATE
with caution on old dates. It is not intended for use with values that
[923],
unix_timestamp
923
[462]
system variable
to 31, or
for dates such as
1
0
= Monday, ...,
2
to 366.
1
Section 12.8, "What Calendar Is Used By
[923]
argument as a value in
format, depending on whether the function is used in a
UNIX_TIMESTAMP()
(Section 10.7, "MySQL Server
'0000-00-00'
= Saturday). These index
7
[919]
DATE_ADD()
'YYYY-MM-DD
unix_timestamp
[931]
function.
or
is an

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents