Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Databases
  • SQL
  • MySQL
  • PostgreSQL
  • PL/SQL
  • MongoDB
  • SQL Cheat Sheet
  • SQL Interview Questions
  • MySQL Interview Questions
  • PL/SQL Interview Questions
  • Learn SQL and Database
Open In App
Next Article:
DATEDIFF() Function in MySQL
Next article icon

DATE_ADD() Function in MySQL

Last Updated : 25 Nov, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report

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 –
    Here the value is the date or time interval to add. This value can be both positive and negative. And here the addunit is the type of interval to add such as SECOND, MINUTE, HOUR, DAY, YEAR, MONTH, etc.

Returns :

It returns the new date after the addition of a specified time or date.

Example 1:

Getting a new date of “2020-11-22” after the addition of 3 years to the specified date “2017-11-22”.

SELECT DATE_ADD("2017-11-22", INTERVAL 3 YEAR);    

Output:

2020-11-22    

Example 2:

Getting a new date of “2020-11-22” after the addition of 2 months to the specified date “2020-9-22”.

SELECT DATE_ADD("2020-9-22", INTERVAL 2 MONTH);    

Output:

2020-11-22    

Example 3:

Getting a new date of “2020-11-22” after the addition of 10 days to the specified date “2020-11-12”.

SELECT DATE_ADD("2020-11-12", INTERVAL 10 DAY);    

Output:

2020-11-22    

Example 4:

Getting a new date of “2020-11-22 09:12:10” after the addition of 3 hours to the specified date “2020-11-22 06:12:10”.

SELECT DATE_ADD("2020-11-22 06:12:10", INTERVAL 3 HOUR);    

Output:

2020-11-22 09:12:10    

Example 5:

Getting a new date of “2020-11-22 09:09:10” after the addition of 3 minutes to the specified date “2020-11-22 09:06:10”.

SELECT DATE_ADD("2020-11-22 09:06:10", INTERVAL 3 MINUTE);    

Output:

2020-11-22 09:09:10    

Example 6:

Getting a new date of “2020-11-22 09:09:10” after the addition of 5 seconds to the specified date “2020-11-22 09:09:5”.

SELECT DATE_ADD("2020-11-22 09:09:5", INTERVAL 5 SECOND);    

Output:

2020-11-22 09:09:10    


Next Article
DATEDIFF() Function in MySQL

K

Kanchan_Ray
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
  • 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
  • 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
  • DATEDIFF() Function in MySQL
    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
    2 min read
  • MySQL ADDTIME() function
    MySQL ADDTIME() function adds the specified time intervals to the given date and time. It returns the date or DateTime value after adding the time interval. SyntaxThe MySQL ADDTIME() function syntax is: ADDTIME(expr1, expr2) ParameterADDTIME() function accepts two parameters. expr1: The given dateti
    2 min read
  • CURRENT_DATE() Function in MySQL
    In this article, you will see how you can use the current_date function and you will see both formats in the string and numeric respectively. CURRENT_DATE : In this function, you will see how you can use the current date function. In MSQSSL, format of date '‘YYYY-MM-DD’(in string) format or YYYYMMDD
    1 min read
  • DAYNAME() Function in MySQL
    DAYNAME() function : This function in MySQL is used to return the weekday name for a specified date. Syntax : DAYNAME(date) Parameter : This method accepts a parameter which is illustrated below as follows. date - Specified date to extract the weekday name from Returns : It returns the weekday name
    1 min read
  • COT() Function in MySQL
    COT() function : This function in MySQL is used to return the cotangent of a specified number. If the specified number is 0, an error or NULL will be returned. In a right triangle, the cotangent of an angle is the length of it's adjacent side divided by the length of the opposite side. Similarly, th
    1 min read
  • STR_TO_DATE() function in MySQL
    STR_TO_DATE() : This function in MySQL helps to convert string values to date or time or DateTime values. The function will return zero (0000-00-00) if an empty string is passed as an argument. Syntax : STR_TO_DATE(string, format) Parameters : string -The string which will be converted to DateTime.
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences