SQL – MySQL LAST_DAY() Function
The MySQL LAST_DAY() function extracts the last day of the month for a given date.
The MySQL LAST_DAY() function extracts the last day of the month for a given date.
The MySQL LOCALTIME() function returns the current date and time as “YYYY-MM-DD HH-MM-SS” (string) or as YYYYMMDDHHMMSS.uuuuuu (numeric).
The MySQL LOCALTIMESTAMP() function returns the current date and time as “YYYY-MM-DD HH-MM-SS” (string) or as YYYYMMDDHHMMSS.uuuuuu (numeric).
The MySQL MAKEDATE() function creates and returns a date based on a year and a number of days value.
The MySQL MAKETIME() function creates and returns a time based on an hour, minute, and second value.
The MySQL MICROSECOND() function returns the microsecond part of a time/datetime (from 0 to 999999).
The MySQL MINUTE() function returns the minute part of a time/datetime (from 0 to 59).
The MySQL MONTH() function returns the month part for a given date (a number from 1 to 12).
The MySQL MONTHNAME() function returns the name of the month for a given date.
The MySQL NOW() function returns the current date and time as “YYYY-MM-DD HH:MM:SS” (string) or as YYYYMMDDHHMMSS.uuuuuu (numeric).
The MySQL PERIOD_ADD() function adds a specified number of months to a period and will return the result formatted as YYYYMM.
The MySQL PERIOD_DIFF() function returns the difference between two periods (both periods should be in the same format). The result will be in months.
The MySQL QUARTER() function returns the quarter of the year for a given date value (a number from 1 to 4).
The MySQL SECOND() function returns the seconds part of a time/datetime (from 0 to 59).
The MySQL SEC_TO_TIME() function returns a time value (in format HH:MM:SS) based on the specified seconds (positive or negative).
The MySQL STR_TO_DATE() function returns a date based on a string and a format.
The MySQL SUBDATE() function subtracts a time/date interval from a date and then returns the new date.
The MySQL SUBTIME() function subtracts time from a time/datetime expression and then returns the new time/datetime.
The MySQL SYSDATE() function returns the current date and time as “YYYY-MM-DD HH:MM:SS” (string) or as YYYYMMDDHHMMSS (numeric).
The MySQL TIME() function extracts the time part from a given time/datetime, and returns “00:00:00” if not a datetime/time, or NULL if expression is NULL.