Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Python Programs
    • Java Programs
    • SQL FAQ’s

MySQL ADDTIME Function

by suresh

MySQL ADDTIME function is one of the Date Functions, used to add time to existing time or DateTime expression. The basic syntax of the ADDTIME() Function in MySQL is as shown below:

ADDTIME(DateTime1 or Time_Expression1, Time_Expression2);

This ADDTIME function adds the Time_Expression2 value to DateTime1 or Time_Expression1.

MySQL ADDTIME function Example

The following are the list examples that help you understand the use of this MySQL ADD TIME function to add a specified time to a given time or DateTime expression.

In this MySQL Addtime function example, first, we are adding 12 Hours, 10 Minutes, and 12 Seconds to a time expression. Next, we added the same along with 111222 Microseconds.

SELECT ADDTIME('10:11:22', '12:10:12');

SELECT ADDTIME('10:11:22', '12:10:12.111222');

SELECT ADDTIME('10:11:22.333444', '12:10:12.111222');

OUTPUT

MySQL ADDTIME Function 1

In this MySQL Add Time function example, we added 12 Hours, 10 Minutes, 12 Seconds, and 111222 Microseconds. Next, we used 90 Hours and 3600 Hours. The impact of adding these many hours change the date’s value too.

SELECT ADDTIME('2019-02-28 16:11:22.333444', '12:10:12.111222');

SELECT ADDTIME('2019-02-28 16:11:22.333444', '90:10:12.111222');

SELECT ADDTIME('2019-02-28 16:11:22.333444', '3600:10:12');

OUTPUT

MySQL ADDTIME Function 2

Placed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions
  • C Tutorial
  • C# Tutorial
  • Java Tutorial
  • JavaScript Tutorial
  • Python Tutorial
  • MySQL Tutorial
  • SQL Server Tutorial
  • R Tutorial
  • Power BI Tutorial
  • Tableau Tutorial
  • SSIS Tutorial
  • SSRS Tutorial
  • Informatica Tutorial
  • Talend Tutorial
  • C Programs
  • C++ Programs
  • Java Programs
  • Python Programs
  • MDX Tutorial
  • SSAS Tutorial
  • QlikView Tutorial

Copyright © 2021 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy