DATEDIFF() Function in MySQL Last Updated : 25 Nov, 2020 Comments Improve Suggest changes Like Article Like Report DATEDIFF() function in MySQL is used to return the number of days between two specified date values. Syntax: DATEDIFF(date1, date2) Parameter: This function accepts two parameters as given below: date1: First specified datedate2: Second specified date Returns : It returns the number of days between two specified date values. Example 1 : Getting the number of days between two specified date values where the date is specified in the format of YYYY-MM-DD. Here the date1 is greater than date2, so the return value is positive. SELECT DATEDIFF("2020-11-20", "2020-11-1"); Output : 19 Example 2: Getting the number of days between two specified date values where the date is specified in the format of YYYY-MM-DD. Here the date1 is less than date2, so the return value is negative. SELECT DATEDIFF("2020-11-12", "2020-11-19"); Output: -7 Example 3: Getting the number of days between two specified date values where the date is specified in the format of YYYY-MM-DD HH-MM-SS. SELECT DATEDIFF("2020-11-20 09:34:21", "2020-11-17 09:34:21"); Output: 3 Example 4: Getting the number of days between two specified date values where the date is specified in the format of YYYY-MM-DD HH-MM-SS. Here time value does not matter as date1 and date2 are taken the same but time is different still the output is zero (0). SELECT DATEDIFF("2020-11-20 09:34:21", "2020-11-20 08:11:23"); Output: 0 Comment More infoAdvertise with us Next Article DATEDIFF() Function in MySQL K Kanchan_Ray Follow Improve Article Tags : SQL mysql Similar Reads ADDDATE() function in MySQL The ADDDATE() function in MySQL is a powerful tool for adding specific time intervals to date or datetime values. It simplifies data manipulation by allowing us to easily calculate future or adjusted dates based on a given starting point. In this article, we will learn about the ADDDATE() function i 3 min read CURDATE() Function in MySQL The CURDATE() function in MYSQL is used to return the current date. The date is returned to the format of "YYYY-MM-DD" (string) or as YYYYMMDD (numeric). This function equals the CURRENT_DATE() function. In this article, we are going to discuss about CURDATE() function in detail. Syntax CURDATE(); P 2 min read DATE_ADD() Function in MySQL DATE_ADD() function in MySQL is used to add a specified time or date interval to a specified date and then return the date. Syntax: DATE_ADD(date, INTERVAL value addunit) Parameter: This function accepts two parameters which are illustrated below: date - Specified date to be modified. value addunit 2 min read DAY() Function in MySQL DAY() function : This function in MySQL is used to return the day of the month for a specified date (a number from 1 to 31). This function equals the DAYOFMONTH() function. Syntax : DAY(date) Parameter : This method accepts a parameter which is illustrated below : date : Specified date to extract th 1 min read UTC_DATE() function in MySQL UTC_DATE() function in MySQL is used to check current Coordinated Universal Time (UTC) date. It returns the UTC date value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in string or numeric context. Syntax : UTC_DATE OR UTC_DATE() Parameter : This method does not acce 2 min read Like