Collections:
ADDTIME() - Adding Time
How to add a time interval from a given date or time value using the ADDTIME() function?
✍: FYIcenter.com
ADDTIME(time, expr) is a MySQL built-in function that
adds a time interval to a given date or time value.
For example:
SELECT ADDTIME('2022-12-31 23:59:59.999999', '1 1:1:1.000002');
-- +---------------------------------------------------------+
-- | ADDTIME('2022-12-31 23:59:59.999999', '1 1:1:1.000002') |
-- +---------------------------------------------------------+
-- | 2008-01-02 01:01:01.000001 |
-- +---------------------------------------------------------+
SELECT ADDTIME('01:00:00.999999', '02:00:00.999998');
-- +-----------------------------------------------+
-- | ADDTIME('01:00:00.999999', '02:00:00.999998') |
-- +-----------------------------------------------+
-- | 03:00:01.999997 |
-- +-----------------------------------------------+
Reference information of the ADDTIME() function:
ADDTIME(expr1, expr2): modtime Adds expr2 to expr1 and returns the result. expr1 is a time or datetime expression, and expr2 is a time expression. Arguments, return value and availability: expr1: Required. The starting time to be added to. expr2: Required. The time interval to be added. modtime: Return value. The updated time. Available since MySQL 4.0.
Related MySQL functions:
⇒ CONVERT_TZ() - Converting Time Zone
⇐ ADDDATE() - Synonym for DATE_ADD()
2023-11-17, 947🔥, 0💬
Popular Posts:
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
How To Present a Past Time in Hours, Minutes and Seconds in MySQL? If you want show an article was p...