Date functions Flashcards
ADDDATE
Adds a time/date interval to a date and then returns the date
ADDTIME
Adds a time interval to a time/datetime and then returns the time/datetime
CURDATE
Returns the current date
CURRENT DATE
Returns the current date
CURRENT TIME
Returns the current time
CURRENT TIMESTAMP
Returns the current date and time
CURTIME
Returns the current time
DATE
Extracts the date part from a datetime expression
DATEDIFF
Returns the number of days between two date values
DATE ADD
Adds a time/date interval to a date and then returns the date
DATE FORMAT
Formats a date
DATE SUB
Subtracts a time/date interval from a date and then returns the date
DAY
Returns the day of the month for a given date
DAYNAME
Returns the weekday name for a given date
DAYOFMONTH
Returns the day of the month for a given date
DAYOFWEEK
Returns the weekday index for a given date
DAYOFYEAR
Returns the day of the year for a given date
EXTRACT
Extracts a part from a given date
FROM DAYS
Returns a date from a numeric datevalue
HOUR
Returns the hour part for a given date
LAST DAY
Extracts the last day of the month for a given date
LOCALTIME
Returns the current date and time
LOCALTIMESTAMP
Returns the current date and time
MAKEDATE
Creates and returns a date based on a year and a number of days value
MAKETIME
Creates and returns a time based on an hour, minute, and second value
MICROSECOND
Returns the microsecond part of a time/datetime
MINUTE
Returns the minute part of a time/datetime
MONTH
Returns the month part for a given date
MOTHNAME
Returns the name of the month for a given date
NOW
Returns the current date and time
QUARTER
Returns the quarter of the year for a given date value
SECOND
Returns the seconds part of a time/datetime
SEC TO TIME
Returns a time value based on the specified seconds
STR TO DATE
Returns a date based on a string and a format
SUBDATE
Subtracts a time/date interval from a date and then returns the date
SUBTIME
Subtracts a time interval from a datetime and then returns the time/datetime
SYSDATE
Returns the current date and time
TIME
Extracts the time part from a given time/datetime
TIME FORMAT
Formats a time by a specified format
TIME TO SEC
Converts a time value into seconds
TIMEDIFF
Returns the difference between two time/datetime expressions
TIMESTAMP
Returns a datetime value based on a date or datetime valu
TO DAYS
Returns the number of days between a date and date “0000-00-00”
WEEK
Returns the week number for a given date
WEEKDAY
Returns the weekday number for a given date
WEEKOFYEAR
Returns the week number for a given date
YEAR
Returns the year part for a given date
YEARWEEK
Returns the year and week number for a given date