MySQL: Date Functions List

Profile picture for user arilio666

Here is the list of date functions in MySQL.

  1. ADDDATE: Adds time/date interval to date and then Gives out the date
  2. ADDTIME: Adds time interval to a time/DateTime and then Gives out the time/DateTime
  3. CURDATE: Gives out the current date
  4. CURRENT_DATE: Gives out the current date
  5. CURRENT_TIME: Gives out the current time
  6. CURRENT_TIMESTAMP: Gives out the current date and time
  7. CURTIME: Gives out the current time
  8. DATE: Gives out the date part from a DateTime expression
  9. DATEDIFF: Gives out the number of days between two date values
  10. DATE_ADD: This function adds time/date interval to date and then Gives out a date
  11. DATE_FORMAT: This function formats date
  12. DATE_SUB: This function subtracts a time/date interval from a date and then Gives out the date
  13. DAY: Gives out the day of the month for a given date
  14. DAYNAME: Gives out the weekday name for a given date
  15. DAYOFMONTH: Gives out the day of the month for a given date
  16. DAYOFWEEK: Gives out the weekday index for a given date
  17. DAYOFYEAR: Gives out a day of the year for a given date
  18. EXTRACT: This function gives out a part from a given date
  19. FROM_DAYS: Gives out a date from a numeric date value
  20. HOUR: Gives out hour part for a given date
  21. LAST_DAY: This function extracts the last day of the month for a given date
  22. LOCALTIME: Gives out the current date and time
  23. LOCALTIMESTAMP: Gives out the current date and time
  24. MAKEDATE: This function both creates and returns a date based on a year and several days value
  25. MAKETIME: This function both creates and returns a time based on an hour, minute and second value
  26. MICROSECOND: Gives out the microsecond part of a time/DateTime
  27. MINUTE: Gives out the minute part of a time/DateTime
  28. MONTH: Gives out the month part for a given date
  29. MONTHNAME: Gives out the name of the month for a given date
  30. NOW: Gives out current date and time
  31. PERIOD_ADD: This one adds the specified number of months to a period
  32. PERIOD_DIFF: Gives out the difference between two periods
  33. QUARTER: Gives out the quarter of the year for a given date value
  34. SECOND: Gives out seconds part of a time/DateTime
  35. SEC_TO_TIME: This returns a time value based on the specified seconds
  36. STR_TO_DATE: This returns a date based on the string and a format
  37. SUBDATE: This function subtracts a time/date interval from a date and then Gives out a date
  38. SUBTIME: This function removes a time interval from a DateTime and then Gives out the time/DateTime
  39. SYSDATE: Gives out  current date and time
  40. TIME: Extracts  time part from a given time/DateTime
  41. TIME_FORMAT: This function formats a time by a specified format
  42. TIME_TO_SEC: This one converts a time value into seconds
  43. TIMEDIFF: Gives out the difference between two time/DateTime expressions
  44. TIMESTAMP: This one returns a DateTime value based on a date or DateTime value
  45. TO_DAYS: Gives out the number of days between a date and date "0000-00-00."
  46. WEEK: Gives out the week number for a given date
  47. WEEKDAY: Gives out the weekday number for a given date
  48. WEEKOFYEAR: Gives out the week number for a given date
  49. YEAR: Gives out the year part for a given date
  50. YEARWEEK: Gives out the year and week number for a given date
Tags