Oracle 5.0 Reference Manual page 945

Table of Contents

Advertisement

mysql>
SELECT HOUR('10:05:03');
-> 10
mysql>
SELECT HOUR('272:59:59');
-> 272
[925]
LAST_DAY(date)
Takes a date or datetime value and returns the corresponding value for the last day of the month.
Returns
if the argument is invalid.
NULL
mysql>
SELECT LAST_DAY('2003-02-05');
-> '2003-02-28'
mysql>
SELECT LAST_DAY('2004-02-05');
-> '2004-02-29'
mysql>
SELECT LAST_DAY('2004-01-01 01:01:01');
-> '2004-01-31'
mysql>
SELECT LAST_DAY('2003-03-32');
-> NULL
[925],
LOCALTIME
LOCALTIME()
[925]
and
LOCALTIME
[925],
LOCALTIMESTAMP
[925]
LOCALTIMESTAMP
MAKEDATE(year,dayofyear)
Returns a date, given year and day-of-year values.
is NULL.
mysql>
SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);
-> '2011-01-31', '2011-02-01'
mysql>
SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);
-> '2011-12-31', '2014-12-31'
mysql>
SELECT MAKEDATE(2011,0);
-> NULL
MAKETIME(hour,minute,second)
Returns a time value calculated from the hour, minute, and
mysql>
SELECT MAKETIME(12,15,30);
-> '12:15:30'
MICROSECOND(expr)
Returns the microseconds from the time or datetime expression
to 999999.
0
mysql>
SELECT MICROSECOND('12:00:00.123456');
-> 123456
mysql>
SELECT MICROSECOND('2009-12-31 23:59:59.000010');
-> 10
[925]
MINUTE(time)
Returns the minute for time, in the range
mysql>
SELECT MINUTE('2008-02-03 10:05:03');
-> 5
[925]
MONTH(date)
Returns the month for date, in the range
or
'0000-00-00'
'2008-00-00'
Date and Time Functions
[925]
[925]
are synonyms for
LOCALTIME()
LOCALTIMESTAMP()
and
LOCALTIMESTAMP()
[925]
[925]
[925]
to 59.
0
to
1
that have a zero month part.
925
NOW()
[925]
[925]
are synonyms for
must be greater than 0 or the result
dayofyear
second
expr
for January to December, or
12
[926].
[926].
NOW()
arguments.
as a number in the range from
for dates such as
0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents