Add 2 seconds to a given time and return the resulting datetime.
| SELECT ADDTIME(“2017-06-15 09:34:21”, “2”); |
The ADDTIME() function adds a specified time interval to a time or datetime value and returns the updated time or datetime.
| ADDTIME(datetime, addtime) |
|
Parameter |
Description |
|
datetime |
Mandatory: The time or datetime value to be modified |
|
addtime |
Mandatory: The time interval to add to the datetime value. Both positive and negative values are permitted. |
|
Works in: |
From MySQL version 4.0 |
Add 5 seconds and 3 microseconds to a given time and return the resulting datetime.
| SELECT ADDTIME(“2017-06-15 09:34:21.000001”, “5.000003”); |
Add 2 hours, 10 minutes, 5 seconds, and 3 microseconds to a given time, then return the resulting datetime.
| SELECT ADDTIME(“2017-06-15 09:34:21.000001”, “2:10:5.000003”); |
Add 5 days, 2 hours, 10 minutes, 5 seconds, and 3 microseconds to a given time, then return the resulting datetime.
| SELECT ADDTIME(“2017-06-15 09:34:21.000001”, “5 2:10:5.000003”); |
Add 2 hours, 10 minutes, 5 seconds, and 3 microseconds to a given time, then return the resulting time.
| SELECT ADDTIME(“09:34:21.000001”, “2:10:5.000003”); |