Date, time and interval scalar functions. "Type" refers to type_expression (for example, float is a reference to float_expression).
FUNCTION | PURPOSE |
CURDATE |
Returns the current date |
CURTIME |
Returns the current time |
CURRENT_DATE |
Returns the current date |
CURRENT_TIME(time_precision) |
Returns the current time |
CURRENT_TIMESTAMP(timestamp-precision) |
Returns the local date and local time as a timestamp |
DAYNAME(date) |
Returns a string with the day of the week |
DAYOFMONTH(date) |
Returns the day of the month, between 1 and 31 |
DAYOFWEEK(date) |
Returns the day of the week as an integer between 1 and 7 |
DAYOFYEAR(date) |
Returns the day of the year between 1 and 366 |
EXTRACT(extract-field FROM extract-source) |
Returns YEAR, MONTH, DAY, HOUR, MINUTE, or SECOND field |
HOUR(time_exp) |
Returns the hour as an integer between 0 and 23 |
MINUTE(time_exp) |
Returns the minute as an integer between 0 and 59 |
MONTH(date) |
Returns the month as an integer between 1 and 12 |
MONTHNAME(date) |
Returns the month name as a string |
NOW |
Returns the current date and time as a timestamp |
QUARTER(date) |
Returns the quarter as an integer between 1 and 4 |
SECOND(time_exp) |
Returns the second as an integer between 0 and 59 |
TIMESTAMPADD |
Calculates a timestamp by adding integer_exp |
TIMESTAMPDIFF |
Returns the integer number of intervals by which |
WEEK(date) |
Returns the week of the year as an integer between 1 and 53 |
YEAR(date) |
Returns the year as an integer in a data source-dependent range |